Skip to main content
Glama
EliyahuAI
by EliyahuAI

wait_for_job

Read-only

Wait for a job to reach a terminal state with live progress notifications, returning the final status for downstream tools.

Instructions

Wait for a job to reach a terminal state, emitting live MCP progress notifications.

Preferred over manually looping get_job_status. The MCP host shows a live progress indicator while this tool holds the connection — no extra token cost.

Architecture ──────────── Every poll cycle does two things in sequence:

  1. Fetch /messages → extract native progress %, emit MCP notification

  2. Fetch /status → act on phase transitions or terminal states

This separation means messages drive the visual indicator (they are more real-time) while status is the authoritative source for workflow transitions. Neither endpoint is used as a shortcut to skip the other; both are polled every cycle so transient failures in one don't cause false terminations.

Progress is always monotonically non-decreasing. Within a phase, msg_progress can oscillate (e.g. QC triggers new row-discovery rounds in the table-maker), but the emitted value is clamped to last_emitted. Across phases a geometric slice scheme is used so the bar never goes backward regardless of how many phases occur.

Progress geometry (lazy split) ────────────────────────────── Starts with the full 0–99 range so single-phase jobs (e.g. full validation after approve_validation) map their native 0–100% directly across the whole bar. On each intermediate phase transition, 80% of the current range is "spent" on the completed phase and the remaining 20% is handed to the next phase — keeping progress monotonic for any number of QC re-discovery rounds or pipeline stages. True terminal always emits exactly 100.

Terminal states: preview_complete, failed, completed-without-intermediate-step. Intermediate: completed + current_step in (Config Generation, Table Making, Claim Extraction, …) — tool advances phase and keeps polling.

Returns the same payload shape as get_job_status so downstream tools (approve_validation, get_results, etc.) apply directly.

job_id: the session_id value returned by upload_file / start_table_validation / start_table_maker. "job_id" and "session_id" are the same string — every workflow uses session_id as its job identifier throughout the pipeline. timeout_seconds: max wall time before returning last known state (default 900). Upload-interview + config-gen phases and large table previews can take up to 15 minutes — set timeout_seconds=900 or higher for long-running jobs. poll_interval: seconds between poll cycles (default 10) warmup_seconds: when > 0, applies synthetic sqrt-curve progress from 0→70% over this many seconds during the pre-message phase (before the first progress message or intermediate step arrives). Use this when the pipeline has a silent setup phase (e.g. instructions= mode where the backend runs an internal AI interview + config generation before preview messages begin). The warmup is automatically disabled once the first intermediate step completes (phase-split takes over). For instructions= mode, pass 300.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
job_idYesSession ID returned by upload_file, start_table_validation, or start_table_maker.
timeout_secondsNoMaximum wall-clock seconds to wait before returning last known state (default 900).
poll_intervalNoSeconds between status poll cycles (default 10).
warmup_secondsNoSeconds of synthetic sqrt-curve progress during silent setup phases (default 0; use 300 for instructions= mode).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

The description discloses extensive behavioral details: the polling cycle (fetch messages then status), progress monotonicity, progress geometry (lazy split with 80/20 rule), terminal vs intermediate states, and the warmup mechanism. These go far beyond the annotations (readOnlyHint, openWorldHint) and are consistent with them.

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 fairly long but well-organized with section headings (Architecture, Progress geometry, etc.). The key purpose and preference statement are front-loaded. Every section provides necessary detail for correct usage, so it earns its length.

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?

Given the complexity (4 parameters, output schema present), the description is complete: it explains return shape (same as get_job_status), covers all parameters with usage notes, details internal polling architecture, and provides edge-case handling (warmup, intermediate phases). No gaps remain.

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

Parameters4/5

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

All 4 parameters have schema descriptions (100% coverage). The description adds extra context: job_id is same as session_id, timeout_seconds default with real-world time guidance, warmup_seconds with use-case-specific advice. This adds meaning beyond the schema, justifying a score above baseline 3.

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 states 'Wait for a job to reach a terminal state, emitting live MCP progress notifications.' This is a specific verb+resource combination and explicitly distinguishes from sibling tool get_job_status by stating it is 'preferred over manually looping get_job_status.'

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 provides clear usage guidance: it is preferred over get_job_status for waiting, and it explains when to use warmup_seconds (e.g., 300 for instructions= mode). However, it does not explicitly state when not to use this tool or list alternatives beyond get_job_status.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/EliyahuAI/mcp-server-subindex'

If you have feedback or need assistance with the MCP directory API, please join our Discord server