Skip to main content
Glama

Run a catalog API

run_api
Idempotent

Runs a catalog API (endpoint_id as find_api returns it; api_id is optional) or one of the caller's own APIs (source_id) and answers with its records. The run is owned by and charged to the caller's workspace. max_items sets how many records it keeps. A run that ends within about 85 seconds answers with its records; a longer run answers with its run_id, which get_run, get_run_items and get_run_result read. A retry with the same idempotency_key and the same arguments answers the same run. An API whose inputs include filters takes the keys and values describe_api_filters lists.

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": {
      "idempotency_key": "<idempotency_key>"
    },
    "name": "run_api"
  }
}

Input Schema

NameRequiredDescriptionDefault
inputNoThe API's inputs, as find_api lists them.
api_idNoFrom find_api. Optional: endpoint_id alone names its API.
fieldsNoOnly these output fields (find_api's run_with lists them).
versionNoThe major version of the catalog API to run (the versions in get_api). Leave it out for the latest. A sunset version runs the latest.
max_itemsNoEnd the run once it has kept this many records; by default it runs until the source is exhausted, its timeout or the budget ends it.
source_idNoInstead of endpoint_id: one of your own APIs, such as one you just built.
endpoint_idNoFrom find_api, copied exactly.
wait_secondsNoHow long this call waits for the run to end before it answers with the run and its run_id. 0 answers at once, with a run_id that get_run, get_run_items and get_run_result read later. MCP clients commonly stop waiting after 90-120 seconds.
idempotency_keyYesYour retry key: the same key answers the same run and never charges twice. Required for a workspace key.
timeout_secondsNoEnd the run after this many seconds of running (time queued does not count); records it kept stay readable.

Output Schema

NameRequiredDescriptionDefault
runNoRunning while queued or running; poll links.self or links.result every poll_after_seconds. Records are readable from links.items while it runs.
messageNo
recordsNo
summaryNo
deliveryNo
metadataNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / properties / api_id / description
      Previous value: -"From find_api (with endpoint_id)."New value: +"From find_api. Optional: endpoint_id alone names its API."
    • changedInput schema / properties / endpoint_id / description
      Previous value: -"From find_api (with api_id)."New value: +"From find_api, copied exactly."
    • changedInput schema / properties / source_id / description
      Previous value: -"Instead of api_id and endpoint_id: one of your own APIs, such as one you just built."New value: +"Instead of endpoint_id: one of your own APIs, such as one you just built."
  2. Changed1 schema field changed
    • changedInput schema / properties / wait_seconds / description
      Previous value: -"How long this call waits for the run to end before it answers with the run and its run_id. 0 answers at once, for a long run read later with get_run, get_run_items and get_run_result. MCP clients commonly stop waiting after 90-120 seconds."New value: +"How long this call waits for the run to end before it answers with the run and its run_id. 0 answers at once, with a run_id that get_run, get_run_items and get_run_result read later. MCP clients commonly stop waiting after 90-120 seconds."
  3. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare openWorld, idempotent and non-destructive, but the description adds genuinely new behavior: the run is owned by and charged to the caller's workspace, and a run exceeding the wait answers with a run_id instead of records. Retry behavior with the same idempotency_key is restated (also in schema), so it adds less than the billing and async-fallback disclosures.

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?

A single dense paragraph that is front-loaded with purpose and the source-selection rule, with no filler sentences. It is on the long side for a description, but nearly every clause carries a distinct operational fact.

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?

For a 10-parameter, nested-input, open-world run tool with an output schema and full annotations, the description covers the sync/async split, billing ownership and retry semantics. Minor tension remains between the stated 'about 85 seconds' cutoff and wait_seconds allowing up to 86400, which could leave an agent unsure how long a single call actually blocks.

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 coverage is 100%, so all ten parameters are already documented, including max_items, wait_seconds and timeout_seconds. The description adds relational meaning beyond the schema for endpoint_id/api_id ('endpoint_id alone names its API') and for the opaque `input` object (keys come from describe_api_filters), which is useful but does not exceed baseline by much.

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 description gives a precise verb+resource pair ('Runs a catalog API ... or one of the caller's own APIs ... and answers with its records') and immediately scopes the two naming paths (endpoint_id vs source_id). An agent can distinguish this from find_api (discovery), get_run/get_run_items (retrieval) and schedule_run (scheduling) without opening any schema.

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?

It routes the agent explicitly: endpoint_id comes from find_api, source_id is for your own APIs, and long runs hand off to get_run/get_run_items/get_run_result via run_id. Filter inputs are deferred to describe_api_filters. The only gap is an explicit statement of when NOT to call this (e.g. to merely inspect an API), which is left implicit.

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.