Skip to main content

Tools

Functions for building workspace tools — the reusable capabilities you link to agents. There are four workspace tool types:

TypeBodyEditable interface
llm_tool (prompt)Plain-text promptinwards only
template_toolTemplate textinwards only
code_toolPython (async def handler(event: dict) -> dict:)artifact only
browser_toolPlaywright script (JavaScript)inwards + artifact

A tool has three JSON Schema interfaces: inwards (input), outwards (output — platform-fixed), and artifact (structured result). Which one you can edit depends on the type, as above.

Recommended flow: create the tool minimally, then tool-update to fill in the body, then tool-update-interface to define the schema, then tool-read (with toolVersionId) to verify the draft. Edits create a draft version the user deploys.


tool-create

Create a workspace tool. Provide type and name; body is optional (prefer creating minimal, then filling in via tool-update).

Input

FieldTypeRequiredDescription
typeenumYescode_tool, llm_tool, template_tool, or browser_tool.
namestringYesTool name.
descriptionstringNoShort description.
bodystringNoTool body: prompt/template text, or Python source for code_tool.
inwardsInterfaceModelobject | stringNoInitial inwards JSON Schema.
outwardsInterfaceModelobject | stringNoInitial outwards JSON Schema.
artifactInterfaceModelobject | stringNoInitial artifact JSON Schema.

Output

FieldTypeDescription
toolIdstringId of the new tool (tool_…).
toolTypestringResolved tool type.
toolVersionIdstring | nullId of the created draft version.

tool-read

Read one workspace tool: body (systemPrompt), metadata, LLM options, and the inwards / outwards / artifact interfaces. Optionally read an exact revision with toolVersionId — useful right after create/update to verify a draft.

Input

FieldTypeRequiredDescription
toolRef / toolIdstringYesTool id (tool_…) or resolvable name.
toolVersionIdstringNoSpecific revision (toolv_…) to read instead of the default display version.

Output

FieldTypeDescription
toolobjectTool payload: body, metadata, llmOptions, and interfaces.inwards / outwards / artifact.
resolvedToolVersionIdstring | nullThe version that was read (when toolVersionId was supplied).

tool-update

Update a workspace tool's body and/or metadata. Pass only the fields to change. For code_tool, body must be valid Python (async handler shape, else rejected). If logic changed, follow with tool-update-interface.

Input

FieldTypeRequiredDescription
toolIdstringYesTool id.
typeenumNocode_tool / llm_tool / template_tool.
displayNamestringNoNew display name.
descriptionstringNoNew description.
bodystringNoNew body (prompt/template/Python).

Output

FieldTypeDescription
toolIdstringThe tool id.
toolTypestringThe tool type.
toolVersionIdstring | nullThe draft version the change was written to.

tool-update-interface

Update exactly one JSON Schema interface on a tool. The editable interface depends on type: llm_tool and template_toolinwards; code_toolartifact. outwards is platform-fixed and cannot be edited here.

Input

FieldTypeRequiredDescription
toolIdstringYesTool id or resolvable name.
whichenumYesinwards, outwards, or artifact (must match the type's editable interface).
modelJsonobject | stringYesThe JSON Schema, as an object or a JSON string.

Output

FieldTypeDescription
toolIdstringThe tool id.
toolTypestringThe tool type.
toolVersionIdstring | nullThe draft version the interface was written to.