v36

latestOpenAPI 3.1.0raw.githubusercontent.com2025-10-091882241.2 MB
tools

Run Tool From Source

Attempt to build a tool from source, then run it on the provided arguments

post/v1/tools/run

Request body

source_codestring required

The source code of the function.

argsobject required

The arguments to pass to the tool.

env_varsobject

The environment variables to pass to the tool.

namestring nullable

The name of the tool to run.

source_typestring nullable

The type of the source code.

args_json_schemaobject nullable

The args JSON schema of the function.

json_schemaobject nullable

The JSON schema of the function (auto-generated from source_code if not provided)

Response

Successful Response

idstring required
datestring date-time required
namestring nullable
message_type'tool_return_message'

The type of the message.

otidstring nullable
sender_idstring nullable
step_idstring nullable
is_errboolean nullable
seq_idinteger nullable
run_idstring nullable
tool_returnstring required
status'success' | 'error' required
tool_call_idstring required
stdoutstring[] nullable
stderrstring[] nullable