Skip to content

feat: Add update-actor tool - #1436

Draft
DaveHanns wants to merge 7 commits into
refactor/actor-resolutionfrom
feat/update-actor
Draft

DaveHanns wants to merge 7 commits into
refactor/actor-resolutionfrom
feat/update-actor

Conversation

@DaveHanns

Copy link
Copy Markdown
Contributor

What

update-actor: changes an Actor's name, title, description, SEO title and description, categories, deprecation, default run options, and standby settings. Only the fields given are sent.

Why

Nothing over MCP can change what an Actor says about itself, and apify push sets title and description only when it creates the Actor. Closes #1413. Part of Epic #1412.

How

  • Mimics update-actor-task: one partial-update tool, rename included, not marked destructive. The name field says that renaming changes the Actor's URL and every username/name reference; a rename that only changes letter case is recognized as no URL change.
  • PUT /v2/actors/{actorId} merges defaultRunOptions and actorStandby sub-fields server-side, so no read-and-merge is needed. categories replaces the whole list.
  • Zod mirrors the platform limits: name rules from @apify/consts, title 63, description 300, SEO title 60, SEO description 200, at most 3 categories from ACTOR_CATEGORIES, and memory a power of two from 128 to 32768.
  • No isPublic: publishing is its own pair of tools (publish-actor and unpublish-actor: make an Actor public or private #1419). Admin-only standby fields are not exposed.
  • A name clash (409) and schema errors (400) come back as soft failures with the platform's message.

Testing

Unit tests cover each field's payload, the limits, the rename texts, at least one field required, another account refused, not found, the API error mapping, and schema conformance. type-check, lint, format, test:unit, check:agents pass.

Notes

AI disclosure: implemented with Claude Code; awaiting human review.

🤖 Generated with Claude Code

update-actor (#1413) checks a new Actor name against the same platform rule that resolveActorNameInput applies to the actor argument, and should answer with the same message.
Nothing over MCP could change an Actor's name, title, description, SEO texts, Store categories, deprecation, default run options, or standby settings; agents had to send the user to Console. update-actor is update-actor-task applied to Actors: one partial update of an Actor in the caller's own account, resolved by ID or name, rename included.

Only the given fields are sent. PUT /v2/acts/{actorId} merges the given defaultRunOptions and actorStandby sub-fields into the stored ones, so no read-and-merge is needed. The input schema mirrors the platform limits, and the name rule and the power-of-two memory rule are checked in code because the shared AJV compiler drops pattern. A name clash, a schema violation and other 4xx answers become user errors with the API's reason.

The tool joins the actors category, so it is served by default; the tests that pin the default tool list and the category contents change with it.

Resolves #1413.
The platform matches Actor names regardless of case, so renaming
my-actor to My-Actor keeps the URL and every existing reference
working. The note said they changed.
A 401 (invalid or expired token) was recorded as an input error.
The shared failure classifier puts 401 and 403 under AUTH, so this
tool now does the same.
That is the main visible effect of deprecating a public Actor, and
the field text did not mention it, so an agent could not tell the
user.
The comment said JSON Schema cannot express the power-of-two rule.
An enum of the nine values can, and the shared AJV enforces enum.
The code check is there so the error names the rule.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants