Sume MCP script_run: fan out 3+ calls in one turn, 55 s limit

script_run runs a short JavaScript program on Sume that calls tools in a loop or in parallel. timeout_seconds is 5 to 55. Use it for 3+ similar calls.

5 min readSume
All posts

Use script_run when one agent turn needs three or more independent calls of the same shape, such as one tts_create per sentence or one generate_image per scene. The program runs on the Sume side, calls tools with await sume.call(name, arguments), and returns one value. timeout_seconds runs from 5 to 55.

script_run limits, read 2026-10-08
ItemValue
timeout_seconds5 to 55
Other limitsmax_calls, max_paid_calls
ReturnsValue, calls[] journal, child jobs[]
Cannot callDiscovery tools or script_run itself

Same gates as direct calls

A call inside the script has the same gates, redaction and errors as a direct call. Paid creates still need their own idempotency_key, and under OAuth read-only the paid tools are not available. Keep max_paid_calls low so a loop cannot run away.

Arguments

This read-only example runs three account lookups in parallel in one tool call. A paid fan-out has the same shape, with generate_image and one idempotency_key per call, and the agent then uses one jobs_wait with job_ids.

{
  "timeout_seconds": 30,
  "max_calls": 3,
  "max_paid_calls": 0,
  "code": "return Promise.all(['account_me', 'balance_get', 'usage_get'].map(n => sume.call(n, {})));"
}

After the script

The response lists child jobs[], which you hand to jobs_wait. Do not put a long wait inside the script: the whole run has a 55-second ceiling, and a render takes longer than that. Submit in the script, wait outside it, and read the batch with jobs_result.

  • Good fit: N similar submits, a loop with a condition, a fan-out and merge.
  • Poor fit: one call, or waiting on a long render.
  • Check the calls[] journal for errors on individual calls.

Reading the journal

The calls[] journal records each tool call the script made. Scan it for failures before trusting the returned value, since one failed call can sit inside a successful script. Child jobs[] hold the job ids created by paid calls, which you pass to jobs_wait.

When not to use it

For one or two calls, a direct tool call is simpler and easier to review. Scripts hide the individual steps from the approval prompt, so keep max_calls and max_paid_calls small, and keep paid scripts for tasks where the user already confirmed the spend.

Pick timeout_seconds to match the slowest call you expect inside the script. Submits return quickly, so 30 seconds is plenty for a fan-out of creates. Reads of large results take longer, and the full 55 is there for them. If a script hits its limit, check the journal to see which calls finished before it stopped, and do not repeat those that already created paid jobs.

Keep in mind that Sume's hosted endpoint is the same for every client in this series: https://mcp.sume.com/mcp, with OAuth consent on the MCP host or an API key in a header. What differs is each client's config keys, its timeout defaults and its approval prompts. When a connection misbehaves, first separate those two layers: test the endpoint with curl and your credential, and only then look at the client's settings.

Sources

More in Integrations

All Integrations posts

Written by Sume