Create tool

http
POST /projects/{project_reference}/tools

Create a project tool source file in the project source or a preview branch so project agents can call it; returns the tool source document. Requires project.agents.write.

Parameters

NameInRequiredDescription
project_referencepathYesProject slug, UUID, or domain that identifies the project.
source_target_kindquery
target_branch_idquery

Request body

FieldTypeRequiredDescription
idstringYesTool ID, a lowercase slug; it also names the tool source file.
descriptionstring,nullTool description. Null leaves it empty. On update, REST and GraphQL clear an omitted description and the MCP tool keeps the current one.
sourcestringComplete TypeScript source of the tool file. When set it is written as-is and description is ignored.

Responses

StatusDescription
201Created tool document
400Bad request
401Unauthorized
403Forbidden
409Conflict