Skip to main content
Glama

Run batch (fan-out)

run_batch

Run many jobs at once with a concurrency limit and an optional total price limit. Returns a batch_id immediately; each job has its own result, failed jobs do not stop the others. Jobs can depend on other jobs of the batch (depends_on, inputs.from_index).

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": {
      "jobs": "<jobs>"
    },
    "name": "run_batch"
  }
}

Input Schema

NameRequiredDescriptionDefault
jobsYesJobs (1–1000). Each takes the same fields as run_job, plus depends_on (indexes of jobs in this batch).
nameNoOptional name of the batch.
defaultsNoFields applied to every job unless the job sets them (e.g. template, timeout_s, artifacts).
webhook_urlNoOptional public https:// URL that gets a signed POST (batch.finished) when all jobs ended.
max_total_costNoOptional price limit for the whole batch in your account's billing currency, e.g. "2.00". Refused if the worst case could exceed it.
idempotency_keyNoOptional: the same key returns the same batch (safe to retry this call).
max_concurrencyNoHow many jobs of the batch may run at the same time (default 10).
max_total_cost_eurNoOptional price limit for the whole batch in EUR – only for accounts billed in EUR; prefer max_total_cost.

Output Schema

NameRequiredDescriptionDefault
job_idsYesIDs of the jobs in the batch, in order.
batch_idYesBatch ID (bat_…).
currencyNoCurrency of max_cost.
max_costNoWorst-case cost of the batch (empty if unknown).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=false, destructiveHint=false, openWorldHint=true, so the mutation profile is partly covered. The description still adds real value beyond that: immediate return of a batch_id (asynchronous execution), per-job results, and failure isolation where a failed job does not stop the others. It does not cover permissions, retry semantics, or whether partial failures are billed, which keeps it at a 3 rather than higher.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three short sentences, front-loaded with the core action and cost/concurrency scoping, then execution semantics. No filler, though the dependency sentence is terse enough that it slightly under-explains the mechanism it introduces.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With an output schema present, return values need not be described, and the description covers async behavior, failure isolation, and dependency graphs for a fairly complex fan-out tool. The remaining gap is operational guidance after submission (how to track or cancel a batch), which is left entirely to sibling tools.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all 8 parameters and the baseline is 3. The description does add cross-field meaning by naming depends_on and inputs.from_index, a reference mechanism not described anywhere in the schema; however it stops short of explaining how indices are resolved or validated.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ("Run many jobs at once") and immediately scopes it as a fan-out with a concurrency limit and optional total price cap. That scope naturally distinguishes it from the single-job sibling run_job without needing to name it, and the dependency clause adds further precision.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies the use case (many jobs at once, with concurrency/cost control) but never states when to prefer this over run_job, nor when not to use it. It also gives no pointer to the natural follow-up tools (get_batch_summary, cancel_batch, wait_jobs) that an agent would need after receiving a batch_id.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources