Run a script over the shop tools
run_codeRuns a JavaScript function body in a sandbox with no network, files or environment. Each tool is a function shop.<tool>(args) that returns the tool's parsed result; return sets the result of the run, and console output is returned as logs. A run may make up to 30 tool calls and lasts at most 30 seconds. Every call is checked and rate limited exactly like a direct call to that tool, so a run can create, update and cancel checkouts as well as read.
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": {
"code": "<code>"
},
"name": "run_code"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | The body of an async function, e.g. `const r = await shop.find_stores({ query: "shoes" }); return r.stores.length;`. | |
| timeout_ms | No | Optional time limit in milliseconds (default 15000). |