Skip to content

Custom Tools

List Custom Tools

List custom tools for the organization.

Omit limit to get every tool; total is the full count either way.

Parameters

NameInTypeRequiredDescription
include_usagequerybooleannoPopulate calls_30d, agent_count, reference_count and deletion_safety. Left off they are null (= not computed, not zero). Opt-in because it adds a fixed five queries per call, two of which read the org’s live process definitions and agent instructions — worth it for the code-tools table, wasted on the resource pickers that also call this endpoint.
limitqueryintegernoMax rows to return (1-100). Omit to return every row.
offsetqueryintegernoRows to skip — pass the previous response’s next_offset.
org_idpathstring (uuid)yes
project_idquerystringnoFilter by project id, or ‘none’ for uncategorized tools.

Responses

StatusDescriptionBody
200Successful ResponsePage_CustomToolResponse_
422Validation ErrorHTTPValidationError

Create Custom Tool

Create a new custom tool. Requires admin/owner role.

Parameters

NameInTypeRequiredDescription
org_idpathstring (uuid)yes

Request body (required)

FieldTypeRequiredDescription
env_varsstring[]no
namestringyes
source_codestringyes
tagsstring[]no

Responses

StatusDescriptionBody
201Successful ResponseCustomToolResponse
422Validation ErrorHTTPValidationError

GET /api/orgs/{org_id}/custom-tools/{id_or_slug}

Section titled “GET /api/orgs/{org_id}/custom-tools/{id_or_slug}”

Get Custom Tool

Get a custom tool by ID or slug.

Parameters

NameInTypeRequiredDescription
id_or_slugpathstringyes
org_idpathstring (uuid)yes

Responses

StatusDescriptionBody
200Successful ResponseCustomToolResponse
422Validation ErrorHTTPValidationError

PUT /api/orgs/{org_id}/custom-tools/{id_or_slug}

Section titled “PUT /api/orgs/{org_id}/custom-tools/{id_or_slug}”

Update Custom Tool

Update a custom tool. Requires admin/owner role.

Parameters

NameInTypeRequiredDescription
id_or_slugpathstringyes
org_idpathstring (uuid)yes

Request body (required)

FieldTypeRequiredDescription
env_varsstring[]no
is_enabledbooleanno
namestringno
source_codestringno
tagsstring[]no

Responses

StatusDescriptionBody
200Successful ResponseCustomToolResponse
422Validation ErrorHTTPValidationError

DELETE /api/orgs/{org_id}/custom-tools/{id_or_slug}

Section titled “DELETE /api/orgs/{org_id}/custom-tools/{id_or_slug}”

Delete Custom Tool

Delete a custom tool. Requires admin/owner role.

Parameters

NameInTypeRequiredDescription
id_or_slugpathstringyes
org_idpathstring (uuid)yes

Responses

StatusDescriptionBody
204Successful Response
422Validation ErrorHTTPValidationError

POST /api/orgs/{org_id}/custom-tools/{id_or_slug}/execute

Section titled “POST /api/orgs/{org_id}/custom-tools/{id_or_slug}/execute”

Execute Custom Tool

Execute a custom tool (by ID or slug) with provided arg bindings.

Requires admin/owner role.

Parameters

NameInTypeRequiredDescription
id_or_slugpathstringyes
org_idpathstring (uuid)yes

Request body (required)

FieldTypeRequiredDescription
arg_bindingsobjectno

Responses

StatusDescriptionBody
200Successful ResponseCustomToolRunResponse
422Validation ErrorHTTPValidationError

GET /api/orgs/{org_id}/custom-tools/{id_or_slug}/revisions

Section titled “GET /api/orgs/{org_id}/custom-tools/{id_or_slug}/revisions”

List Custom Tool Revisions

List a code tool’s version history, newest first (by tool ID or slug).

Parameters

NameInTypeRequiredDescription
id_or_slugpathstringyes
org_idpathstring (uuid)yes

Responses

StatusDescriptionBody
200Successful ResponseCustomToolRevisionSummary[]
422Validation ErrorHTTPValidationError

GET /api/orgs/{org_id}/custom-tools/{id_or_slug}/runs

Section titled “GET /api/orgs/{org_id}/custom-tools/{id_or_slug}/runs”

List Tool Runs

List recent runs for a custom tool.

Parameters

NameInTypeRequiredDescription
id_or_slugpathstringyes
limitqueryintegerno
offsetqueryintegerno
org_idpathstring (uuid)yes

Responses

StatusDescriptionBody
200Successful ResponseCustomToolRunResponse[]
422Validation ErrorHTTPValidationError

GET /api/orgs/{org_id}/custom-tools/{id_or_slug}/runs/{run_id}

Section titled “GET /api/orgs/{org_id}/custom-tools/{id_or_slug}/runs/{run_id}”

Get Tool Run

Get a specific tool run by ID.

Parameters

NameInTypeRequiredDescription
id_or_slugpathstringyes
org_idpathstring (uuid)yes
run_idpathstring (uuid)yes

Responses

StatusDescriptionBody
200Successful ResponseCustomToolRunResponse
422Validation ErrorHTTPValidationError

GET /api/orgs/{org_id}/custom-tools/{id_or_slug}/usage

Section titled “GET /api/orgs/{org_id}/custom-tools/{id_or_slug}/usage”

Get Custom Tool Usage

Who still uses this code tool — calls, process references, instruction references.

A dedicated sub-resource rather than fields on GET /{id_or_slug}, for the same reason /runs is one: the tool row is fetched on every render of the tool page and by the editor, while this needs a per-agent aggregate plus a scan of every live process definition and agent instruction in the org. Folding it in would put that cost on paths that never show it.

Requires org membership — reading usage is a member right, like history.

Parameters

NameInTypeRequiredDescription
id_or_slugpathstringyes
org_idpathstring (uuid)yes
window_daysqueryintegernoCall window in days. References are not windowed.

Responses

StatusDescriptionBody
200Successful ResponseCustomToolUsageResponse
422Validation ErrorHTTPValidationError

POST /api/orgs/{org_id}/custom-tools/validate

Section titled “POST /api/orgs/{org_id}/custom-tools/validate”

Validate Source

Validate Python source code without saving. Requires admin/owner role.

Parameters

NameInTypeRequiredDescription
org_idpathstring (uuid)yes

Request body (required)

FieldTypeRequiredDescription
env_varsstring[]no
source_codestringyes

Responses

StatusDescriptionBody
200Successful ResponseValidateSourceResponse
422Validation ErrorHTTPValidationError