run_scratch_code
Run JavaScript or TypeScript in the workspace sandbox without creating a playbook or run record. Use when probing an API, checking credentials, or trying step code before wiring a playbook (for example lead enrichment or invoice lookups). Pass a short plain-English description (3-8 words) shown as the step title. Default and max wait is 50s (timeoutClamped: true if a larger timeout is passed). Default allowNetwork is false; set true for fetch and metaphor.*. Pass secretNames to inject vault values; missingSecret lists names that were absent. Never print secret values. Optional packages install in the sandbox; if install plus execute exceeds 50s the call times out. Existing attachment keys: pass in input and read with metaphor.attachment(key). No upload on this tool.
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": {
"language": "<language>",
"code": "<code>"
},
"name": "run_scratch_code"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Full source to execute in the sandbox harness. | |
| input | No | JSON object available as input_data inside the sandbox. | |
| timeout | No | Max execution time in ms. Default and maximum 50000 on inbound MCP. | |
| language | Yes | ||
| packages | No | ||
| description | No | Short plain-English description of what this code does (3-8 words, active voice, e.g. "Fetch open HubSpot deals" or "Test Zendesk ticket search"). Shown to the user as the step title. | |
| secretNames | No | ||
| allowNetwork | No | Allow network (metaphor.*, fetch). Default false. |