Skip to main content

update_resource

Edit an existing resource: change its label and/or replace its content. Address it by its path — set team for a team resource. The path itself cannot be changed. Fails if no such resource exists in the target space.

With a credential that represents a user, omitting team targets that user's space. A team must be bound to the credential and the credential must be allowed to manage it; a userless organization credential must name such a team.

Only the fields you provide change; everything you omit is left as-is. To replace content, first read the resource and send its version as expected_version. If another write has changed the content, the update fails with resource_conflict; re-read and reconcile your changes before retrying. Do not substitute a newer version without reviewing its content.

Parameters​

ParameterTypeRequiredDescription
pathstringYesThe resource to update, addressed by its path. The path itself cannot be changed.
teamstringNoThe team that owns it. Omit to target the represented user's space.
namestringNoReplace the human-readable label.
contentstringNoReplace the content. Provide alongside content_encoding for binary content.
content_typestringNoMIME type for the new content. Only used when content is given; defaults to the existing type.
content_encodingstringNoEncoding of content: utf8 (default) or base64. Only used when content is given.
expected_versionintegerWith contentThe positive integer version of the content your replacement is based on. Required when replacing content; sending it without new content is rejected. A changed version causes resource_conflict.

Response​

FieldTypeDescription
pathstringThe resource path.
idstringThe resource's identifier.
versionintegerThe resource's version after the update.

Example​

{
"path": "docs/readme.md",
"name": "Getting started guide",
"content": "# Getting started (updated)\n...",
"expected_version": 1
}

Result:

{
"path": "docs/readme.md",
"id": "018f...c2a1",
"version": 2
}

Errors​

Each failure carries a precise code in the response. A domain rejection — a not-found, a limit, or a permission denial — is returned as a tool result with isError: true, so the agent can read the code and self-correct; malformed arguments and server faults are JSON-RPC protocol errors.

CodeCauseDelivered as
resource_not_foundNo resource with that path exists in the target space.tool error (isError)
resource_conflictThe content changed since your base version was read or while the call was waiting to write. Re-read and reconcile your changes before retrying.tool error (isError)
invalid_content_encodingcontent_encoding is not utf8 or base64.tool error (isError)
invalid_base64content_encoding is base64 but the content isn't valid base64.tool error (isError)
invalid_content_typecontent_type is not a valid MIME type.tool error (isError)
content_too_largeThe content is larger than the per-call limit — use the dashboard instead.tool error (isError)
storage_limit_reachedYour plan's storage limit has been reached.tool error (isError)
team_not_foundNo team with that name is bound to this credential.tool error (isError)
forbiddenYour credential isn't permitted to update resources.tool error (isError)
personal_cannot_address_teamYou used a team/ prefix (or team field) with a personal credential.tool error (isError)
no_personal_spaceThis credential has no personal space — address a team instead.tool error (isError)
expected_version_requires_contentexpected_version was given without also replacing content.tool error (isError)
missing_required_argumentReplacing content requires expected_version.protocol error (invalid_params)
invalid_argumentsThe arguments do not match the schema, or expected_version is not a positive integer.protocol error (invalid_params)
internal_errorAn unexpected error occurred.protocol error (internal_error)

Notes​

  • The path is the resource's identity and cannot be changed — to "rename" a path, create a new resource and delete the old one.
  • Updating a resource counts as one tool call against your plan's tool-invocation allowance.