Skip to main content
PUT
Save a file in a tool's draft
  • Business accounts only, with tools:build. Every member sees the draft with code.get.
  • One draft per tool, shared by the team. Each save changes one file, and the last save of a file wins.
  • content null deletes the file. A file saved back to its text in the draft’s base version leaves the draft, and a draft with no change left is deleted.
  • Only files under src/, test/ and explore/ change, and an entrypoint can’t be deleted. A public tool’s code is read only, so a save to it is forbidden.
  • Callers: an API key, an MCP OAuth token or a Dashboard session.
  • Permission: tools:build.
  • Effect: Creates or changes something.
  • Errors: business_account_required, not_found, and the errors any request can get.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

a tool ID: tool_ and 32 lowercase hex digits

Example:

"tool_0f8e2d1c4b3a49e8a7f6e5d4c3b2a190"

Body

application/json
path
string
required

a path under src/, test/ or explore/ of letters, digits, '.', '_', '-' and '/', ending in .js, .mjs, .ts or .json

content
string | null
required

The file's new text, or null to delete the file

Response

The tool's draft after the save

draft
object | null
required

The tool's draft after the save, or null when no change is left in it