Create function
create_functionCreate a sandboxed user function in the caller's active workspace. Provide a 'name' (slug [a-z][a-z0-9_]*), an optional 'description', the 'code' (Deno TS/JS — it must define a top-level function main(input) that returns the JSON output; Phase 1 is PURE COMPUTE: no network, no filesystem, no env, no callbacks), an 'input_schema' and 'output_schema' (JSON Schema), and 'expose_as_tool' (default false — when true the function appears as the custom tool fn_ on YOUR workspace's MCP surface only). Enforces the plan's functions_count limit. CONFIRMATION: this tool is PROPOSED, never performed directly. You get status='confirmation_required' with an action_id and a plan_token, and the write happens only after confirm_action.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"name": "<name>",
"code": "<code>"
},
"name": "create_function"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| name | Yes | ||
| description | No | ||
| input_schema | No | ||
| output_schema | No | ||
| expose_as_tool | No |