Skip to main content
Glama

Create runs in a batch

create_runs

Start up to 100 runs of one task with different inputs in one call, and return at once with batch_id, run_ids (in input order), model and a summary. Give the definition once (everything create_run takes except input: a prompt or a saved workflow, input_schema, output_schema, model, web, shell, files, connections, timeout_seconds, max_cost_micros, zero_data_retention) and inputs, one item per run: {input, idempotency_key?, model?}. An item's model replaces the batch's for that run, so one batch can compare models on the same input; when the runs use more than one model, the summary's by_model gives each model's runs, statuses and total cost side by side. Every input is checked against input_schema before any run starts: if one fails, no run starts and the error lists each failure with its index, such as "inputs[3].url: required". Each run is an ordinary run: it has its own max_cost_micros cap, is queued and billed on its own, and counts toward the organization's concurrency limit, so runs beyond it wait in the queue (queue_reason organization_limit). Call get_account first for the limit and the available credit; on the hosted service a batch whose runs' caps together exceed the available credit is refused before it starts. max_total_cost_micros refuses the batch when the number of runs times max_cost_micros exceeds it: a bound on the most the batch can cost, not a shared budget. idempotency_key makes a retry return the same batch instead of starting the runs again; each input without its own key gets <idempotency_key>:. If admission stops part way (for example the wallet refuses a reservation), the error lists admitted_run_ids, and a retry with the same key keeps them and starts the rest. Follow the runs with wait_for_runs and the batch_id. Costs are provisional until cost_final is true. On the hosted service a run costs a run fee once its worker starts, compute per second, model calls at the provider's price plus a percentage, and web requests and searches at flat prices; get_account (REST: GET /v1/me) reports the rates.

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": {
      "inputs": "<inputs>"
    },
    "name": "create_runs"
  }
}

Input Schema

NameRequiredDescriptionDefault
webNoWeb access through Ephemeral's web_fetch and web_search tools: true, false, or an object limiting it. Fetches follow each site's robots.txt, including its rules for every crawler (User-agent: *) when none name EphemeralBot; a refused fetch reaches the agent as an error saying why, not as an empty page, and is not charged.
filesNoFiles placed in the sandbox: inline content, or a file saved in the organization.
modelNoA model id from list_models. Omit for the default.
shellNoWhether the agent may run shell commands in its sandbox (default true). The shell has no network access: web requests go through the web tools (see web), and pip or npm cannot download packages. Python 3.14 with common packages is preinstalled; get_account lists them (python_version, preinstalled_python_packages). Any other Python package can come as a wheel in files, installed with pip install --no-index <path>, where <path> is the wheel's path as listed in the agent's task: files are mounted read-only there, not in the shell's working directory.
stateNoA state store the agent may read and write with its state tools (state_get, state_set, state_delete, state_list), kept across runs: for example, a scheduled run keeps what it saw and reports only what changed since the previous run. Any name: the store is created with its first entry. State is billed with storage, and each write the agent makes is charged to the run (get_storage).
inputsYesOne item per run, in order: the run's input and, optionally, its own idempotency key.
notifyNoTell a saved HTTP connection when every run of the batch has finished and settled (one delivery for the whole batch, with its summary and runs): Ephemeral POSTs JSON (event, the run or batch with its status, output, error and final cost, and a one-line text) to the connection's URL plus path, with the connection's own credentials. The connection must be an HTTP connection that allows POST (see list_connections); a failed delivery is retried for a while.
promptNoWhat the agent should do. Required unless workflow is set.
outputsNoFiles the agent makes that are saved when the run ends, such as ["chart.png", "/tmp/report.docx"]: paths relative to the agent's working directory, or under /tmp/. The agent is told to write them there. Each becomes an organization file named runs/<run id>/<path>, listed in the finished run's files (with its id) and by list_files with run_id; read one with read_file. At most 20 files, 10 MiB each and 25 MiB in all; a missing path is reported in the run's events (output_missing), not as a failure. Stored files are billed with storage (get_storage).
workflowNoName of a saved workflow to run instead of a prompt (see list_workflows).
connectionsNoSaved connections the agent may use, keyed by the name the agent sees. Each refers to a connection saved in the organization and can only narrow it.
descriptionNoWhat the workflow does and what input it expects, in a sentence or two, for people and agents. At most 500 characters.
input_schemaNoA JSON Schema (draft 2020-12 or 7, at most 32 KiB, no references to other documents) that this run's input must match. A run whose input does not match is refused with the path and the reason, such as "input.city: required".
output_schemaNoA JSON Schema (draft 2020-12 or 7, at most 32 KiB, no references to other documents) that this run's output must match. The agent is told the schema and asked to reply with JSON only; the output is then checked, and a run whose output does not match fails with the reason.
idempotency_keyNoA retry with the same key returns the original batch instead of starting its runs again.
max_cost_microsNoCost cap in millionths of a dollar; the run stops at the cap. Defaults to default_max_cost_micros (get_account). On the hosted service it must cover at least the run fee plus compute for the whole timeout: run_fee_micros + timeout_seconds x compute_micros_per_second, plus zdr_surcharge_percent for a zero-data-retention run (rates from get_account). A smaller cap is refused, and the error's budget object gives the figures, required_max_cost_micros for this timeout and longest_timeout_seconds for this cap.
timeout_secondsNoWall-clock limit for the run, in seconds: default 300 (the workflow's, if it has one), at most 3600. On the hosted service max_cost_micros must cover compute for all of it.
zero_data_retentionNoRecord nothing of the run's content: no events kept, no definition, and the output kept only briefly and released on first retrieval. Output files and state the run is told to save are your storage and are kept as your retention policy says.
max_total_cost_microsNoRefuse the batch if the number of runs times max_cost_micros exceeds this, in millionths of a dollar.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • addedInput schema / properties / inputs / items / properties / model
      Added value: +{
      +  "description": "Run this input with this model (an id from list_models) instead of the batch's model. To compare models on one task, repeat the same input with a different model in each item.",
      +  "type": "string"
      +}
    • addedInput schema / properties / notify
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "Tell a saved HTTP connection when every run of the batch has finished and settled (one delivery for the whole batch, with its summary and runs): Ephemeral POSTs JSON (event, the run or batch with its status, output, error and final cost, and a one-line text) to the connection's URL plus path, with the connection's own credentials. The connection must be an HTTP connection that allows POST (see list_connections); a failed delivery is retried for a while.",
      +  "properties": {
      +    "connection": {
      +      "description": "Name of the saved HTTP connection.",
      +      "type": "string"
      +    },
      +    "on": {
      +      "description": "always (default), or failure: only when a run did not succeed.",
      +      "enum": [
      +        "always",
      +        "failure"
      +      ],
      +      "type": "string"
      +    },
      +    "path": {
      +      "description": "A path relative to the connection's URL, such as /hooks/ephemeral (default: the URL itself).",
      +      "maxLength": 512,
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "connection"
      +  ],
      +  "type": "object"
      +}
    • addedInput schema / properties / outputs
      Added value: +{
      +  "description": "Files the agent makes that are saved when the run ends, such as [\"chart.png\", \"/tmp/report.docx\"]: paths relative to the agent's working directory, or under /tmp/. The agent is told to write them there. Each becomes an organization file named runs/<run id>/<path>, listed in the finished run's files (with its id) and by list_files with run_id; read one with read_file. At most 20 files, 10 MiB each and 25 MiB in all; a missing path is reported in the run's events (output_missing), not as a failure. Stored files are billed with storage (get_storage).",
      +  "items": {
      +    "maxLength": 200,
      +    "type": "string"
      +  },
      +  "maxItems": 20,
      +  "type": "array"
      +}
    • addedInput schema / properties / state
      Added value: +{
      +  "description": "A state store the agent may read and write with its state tools (state_get, state_set, state_delete, state_list), kept across runs: for example, a scheduled run keeps what it saw and reports only what changed since the previous run. Any name: the store is created with its first entry. State is billed with storage, and each write the agent makes is charged to the run (get_storage).",
      +  "type": "string"
      +}
    • changedInput schema / properties / zero_data_retention / description
      Previous value: -"Record nothing of the run's content; the output is kept only briefly and released on first retrieval."New value: +"Record nothing of the run's content: no events kept, no definition, and the output kept only briefly and released on first retrieval. Output files and state the run is told to save are your storage and are kept as your retention policy says."
  2. Changed2 schema fields changed
    • changedInput schema / properties / shell / description
      Previous value: -"Whether the agent may run shell commands in its sandbox."New value: +"Whether the agent may run shell commands in its sandbox (default true). The shell has no network access: web requests go through the web tools (see web), and pip or npm cannot download packages. Python 3.14 with common packages is preinstalled; get_account lists them (python_version, preinstalled_python_packages). Any other Python package can come as a wheel in files, installed with pip install --no-index <path>, where <path> is the wheel's path as listed in the agent's task: files are mounted read-only there, not in the shell's working directory."
    • changedInput schema / properties / web / description
      Previous value: -"Web access: true, false, or an object limiting it."New value: +"Web access through Ephemeral's web_fetch and web_search tools: true, false, or an object limiting it. Fetches follow each site's robots.txt, including its rules for every crawler (User-agent: *) when none name EphemeralBot; a refused fetch reaches the agent as an error saying why, not as an empty page, and is not charged."
  3. Added

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the annotations, it discloses validation-before-start behavior, per-run queueing and billing, concurrency-limit waiting with queue_reason, credit refusal, max_total_cost_micros semantics, idempotency-key retry behavior, partial admission via admitted_run_ids, and provisional costs. These details materially explain how the tool behaves in failure, retry, and cost scenarios, and none contradict the annotations, including idempotentHint=false because idempotency requires an explicit key.

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?

The description is front-loaded with purpose and return shape, and its length is largely justified by a 19-parameter batch tool with complex admission, billing, and idempotency behavior. It is dense and could be easier to scan with more structure, but most sentences carry operational information rather than repetition.

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

Completeness5/5

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

For a complex batch-creation tool with no output schema, the description covers return fields, validation behavior, admission failures, concurrency, cost controls, billing, zero-data-retention implications, and the natural follow-up tool. An agent has enough information to invoke it correctly and interpret both success and partial-failure outcomes.

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

Parameters5/5

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

Although schema coverage is already 100%, the description adds important semantics beyond field definitions: an item's model overrides the batch model, omitting request keys derives keys as <idempotency_key>:<index>, max_total_cost_micros is a bound rather than a shared budget, and validation failures report indexed paths. It also explains how the batch's definition is exactly what create_run accepts except input, which helps an agent map parameters correctly.

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?

The opening sentence states a specific verb (start), resource (runs of one task), batch limit (up to 100), and immediate return values (batch_id, run_ids in input order, model, summary). It clearly distinguishes the batch operation from the single-run sibling create_run by framing it as one call for different inputs.

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

Usage Guidelines4/5

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

The description gives clear usage context: use it for multiple inputs in one call, optionally compare models per input, call get_account first for limits and credit, and follow with wait_for_runs. It does not explicitly say when to prefer create_run over create_runs, but the batch framing and repeated references to create_run make the boundary largely clear.

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