script_run on Sume MCP: what the sandbox cannot call, and its budgets
Sume's script_run tool runs JavaScript that calls other tools with await sume.call. It has 5 to 55 second timeouts, call budgets, and no discovery tools.

script_run on the hosted Sume MCP server runs a short JavaScript program on Sume's side. The program calls other Sume tools with await sume.call(name, args), and the whole run has a timeout of 5 to 55 seconds, a max_calls budget and a max_paid_calls budget. It cannot call the discovery tools or itself, so you do discovery first and hand the script concrete tool names.
What it is for
The point of the tool is to cut round trips. A coding agent that wants to check an account, list a few things and start two jobs would otherwise make many separate tool calls, each one a full model turn. With script_run, one tool call carries the loop, and the result comes back as a value, a calls[] journal of each inner call and the child jobs[] that were started.
Limits at a glance
The limits are the part to design around. They are stated in the tool's own description, so check tools_schema for the live values.
| Limit | Value | Why it matters |
|---|---|---|
| timeout_seconds | 5 to 55 | Short by design; start jobs here, wait elsewhere |
| max_calls | You set it | Caps total inner calls, including reads |
| max_paid_calls | You set it | Caps how many inner calls can be paid |
| Discovery tools | Not callable | Run tools_list and tools_schema outside the script |
| script_run itself | Not callable | No recursion |
Zero is a useful number
Use max_paid_calls: 0 for any script that should only read. If a paid call slips in, the budget refuses it, and the journal shows where. This is a cleaner guardrail than a prompt that says "do not spend", because the limit is enforced by the tool and not by the model's mood.
A read-only script
The arguments below are for a read-only script. The code value is the JavaScript body, account_me is a read tool with no arguments, and the budgets leave no room for a paid call. Pass this object as the arguments of the script_run tool from your MCP client.
{
"code": "const me = await sume.call('account_me', {}); return { me };",
"timeout_seconds": 30,
"max_calls": 3,
"max_paid_calls": 0
}When you do spend
If you do put paid calls in a script, keep the same habits as for direct calls. Each paid tool still wants an idempotency_key, dry_run=true previews the cost, and wallet admission is the real gate. Set max_paid_calls to the exact number you expect, so a bug in a loop cannot start twenty jobs.
Waiting for the result
Long jobs do not fit in a 55-second script, and they should not. Start the jobs inside the script, return their ids, and wait on them with jobs_wait afterwards. If a wait slice expires, wait again on the same ids and never create the job again.
Sources
Related posts
More in Agents
- Seedance video agent in ChatGPT and Claude: Sume MCP compared
InfoseekAI put a Seedance video agent into ChatGPT and Claude over MCP on Oct 1, 2026. What a hosted MCP server like Sume's gives you instead, and when.
- Sume skipped run with previous_run_active: what it means, what to do
A scheduled Sume run is skipped with skip_reason previous_run_active when the last one is still going. It is not billed work. How to detect it and avoid it.
- Sonnet 5.5 vs GPT-6.1 Sol for video scripts: both $2 in, $10 out
Claude Sonnet 5.5 and GPT-6.1 Sol list the same $2 input and $10 output per million tokens (read 2026-10-05), so pick on fit, not price.
- Spend guard layers for an unattended Sume video agent, in order
Five layers cap a Sume agent that runs unattended: key scope, per-run cap, max_spend_usd and dry_run, generation admission, and the wallet. What each one stops.
Written by Sume