Skip to main content
Glama

wait_for_extraction

Waits for an extraction job to complete, fail, or be cancelled, or until timeout, then returns its status without result rows. Call again after a timeout, then fetch results separately.

Instructions

Wait until one job finishes (completed, failed or cancelled) or the timeout passes, then return its status without result rows. Free and read-only. Use it after create_extraction, or for a job id from get_batch or get_plan. Returns timed_out and job; if timed_out is true, call it again. Then read the data with get_extraction_result.

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": {
      "job_id": "<job_id>"
    },
    "name": "wait_for_extraction"
  }
}

Input Schema

NameRequiredDescriptionDefault
job_idYesJob id: job.id from create_extraction, job_id from extract_now, or an id listed by list_extractions, get_batch, get_schedule or get_plan.
timeout_secondsNoLongest time to wait, in seconds, up to 120. Default 60.
poll_interval_secondsNoSeconds between status checks, 0.5-10. Default 2.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.1.1
    • addedInput schema / properties / job_id / description
      Added value: +"Job id: job.id from create_extraction, job_id from extract_now, or an id listed by list_extractions, get_batch, get_schedule or get_plan."
    • addedInput schema / properties / poll_interval_seconds / description
      Added value: +"Seconds between status checks, 0.5-10. Default 2."
    • addedInput schema / properties / timeout_seconds / description
      Added value: +"Longest time to wait, in seconds, up to 120. Default 60."
  2. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations supplied, the description carries the burden and does well: it declares the operation read-only and free (cost-free), discloses that result rows are NOT returned, names the two return fields (timed_out, job), and states the re-poll behavior on timeout. It stops short of stating what happens for an unknown or already-cancelled job id, which is the remaining behavioral ambiguity.

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

Conciseness5/5

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

Four short sentences, front-loaded with the core behavior, then cost/safety, then usage routing, then return contract. Every sentence carries information an agent needs; nothing is redundant with the schema.

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 an asynchronous wait tool with no output schema and no annotations, the description supplies the return contract (timed_out, job), the polling loop, the cost profile, and the correct next call. An agent can invoke and reason about the result without inspecting anything else.

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%, with job_id's accepted sources, the 1-120 second timeout range, and poll interval all documented in the schema. The description adds only that job ids may come from get_batch or get_plan, so the schema does the heavy lifting and the baseline 3 applies.

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 plus its exact termination semantics: "Wait until one job finishes (completed, failed or cancelled) or the timeout passes, then return its status without result rows." The clause "without result rows" distinguishes it from get_extraction_result and get_extraction in the sibling list.

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

Usage Guidelines5/5

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

Explicitly routes usage: "Use it after create_extraction, or for a job id from get_batch or get_plan," and names the follow-up tool (get_extraction_result) for retrieving data. It also gives the loop condition ("if timed_out is true, call it again"), so when to invoke versus when to hand off is fully determined.

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