script_run limits: timeout 5-55 s, max_calls and max_paid_calls
Sume's script_run runs a short script of MCP tool calls with a 5 to 55 second timeout and caps on calls and paid calls. What it returns and cannot call.

script_run is the hosted Sume MCP tool for batching: it runs a short JavaScript program on Sume's side, the program calls other listed tools in a loop, in parallel or conditionally, and returns one value. Three limits bound it: timeout_seconds from 5 to 55, max_calls, and max_paid_calls. The docs give no default values for the last two, so set them explicitly.
Use it when a turn needs three or more independent calls of the same shape, such as one tts_create per sentence or one generate_image per scene. One tool result replaces many, which also shortens the prompt your model reads on the next turn.
What it is and is not
Inside the script, await sume.call(name, arguments) runs any listed tool with the same gates, redaction and errors as a direct call. That is the important part for spend: a script is not a back door.
| Property | Value from the Sume docs (read 2026-10-09) |
|---|---|
timeout_seconds | 5 to 55 |
| Call limits | max_calls and max_paid_calls set per run |
| Paid creates inside the script | Still need their own idempotency_key |
| Returns | The returned value, a calls[] journal, and the child jobs[] to use with jobs_wait |
| Cannot call | Discovery tools, or script_run itself |
Designing around the 55-second ceiling
A script that waits for a video to finish will hit the ceiling. Submit inside the script, return the jobs[], and wait outside it with jobs_wait. The script's job is the fan-out, not the polling.
For the paid limit, estimate the cost first. Say a script submits six scenes at the Sume list rate for a 5-second Wan 3.0 720p clip: 5 x $0.125 = $0.625 each, $3.75 for six. Setting max_paid_calls to 6 stops a runaway loop at six submits, and a per-call max_spend_usd caps each one. The two limits protect against different mistakes: one counts calls, the other counts dollars.
A checklist before you let a model write the script
The model writes the script text, so put the controls in the instructions and verify them in the journal.
- Call
tools_schemaforscript_runand read the argument names for your session. - Require
max_paid_callsand a uniqueidempotency_keyper paid call in the prompt. - Read the
calls[]journal after each run and compare it to the count you expected. - Pass the returned
jobs[]tojobs_waitin slices rather than one long wait.
Why not just let the model loop
A model that issues six tool calls one turn at a time pays for six round trips and re-reads the whole conversation each time. A script does the fan-out in one call. The cost of that convenience is that a mistake is multiplied: a bad argument shape repeats across every iteration. Keep the first run small, with a low max_calls, read the journal, and only then raise the numbers.
The script also cannot discover tools, so the model must already know the exact names and argument shapes from tools_schema. Ask for the schemas before the script, not inside it.
Sources
Related posts
More in Agents
- Seedance 2.5's 4-second minimum costs $1.07 at 480p 9:16
Seedance 2.5 accepts 4 to 30 seconds, and the shortest 480p 9:16 clip is $1.074709, over the $1.00 default schedule cap. Price points and what to do.
- Six locales, six Agent Completions at $2 each: a $12 worst case
One Agent Completion per locale, each with its own spend cap and Idempotency-Key. Six runs at $2 bound generation to $12, and a retry cannot start a seventh.
- Canceled and skipped Sume agent runs send no webhook: what to poll
A Sume run webhook fires only when a run completes or fails. Canceled and skipped runs send nothing, so your scheduler must read status_url for them.
- A 20,000-character narration fits a $1.00 scheduled cap at $0.95
Sume TTS at $0.0475 per 1,000 characters prices 20,000 characters at $0.95, 5 cents under the $1.00 default cap of a schedule. What 21,000 does.
Written by Sume