Skip to main content
Glama

get_job

Returns the job's current state (pending, in_progress, awaiting_approval, completed, failed, or cancelled), intermediate AI responses streamed during execution, the final document HTML once complete, and any pending changes awaiting user approval (with chunk IDs and proposed HTML diffs in metadata.pending_changes). Poll this after chat_async to track progress and retrieve results. When status is awaiting_approval, call POST /v1/chat/{session_id}/approve to approve or deny each pending change. Headless/MCP clients get the same typed progress events the web SSE stream delivers via metadata.intermediate_responses (e.g. documents_changed, continue_prompt, model_fallback, proposed_change_batch); cross-session document updates from OTHER sessions are reported separately by polling GET /v1/sessions/{session_id}/doc-events.

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": "get_job"
  }
}

Input Schema

NameRequiredDescriptionDefault
job_idYes
compactNoWhen true, omit the heavy result body + streamed intermediate events from the response (status/progress/ids/timestamps/pending-change ids remain). Recommended for AI agents polling a large-document job: poll compact while it runs, then fetch once non-compact when status is completed to retrieve the final HTML.
wait_secondsNoOptional: wait up to this many seconds (at most 110) for a pending or running job to settle before answering, so one call replaces a polling loop. 0 (default) answers at once.

Output Schema

NameRequiredDescriptionDefault
errorNoError message. Present when status is 'failed'.
job_idYesUnique job identifier. Use this to poll for status updates.
resultNoJob output. Present when status is 'completed'. Contains AI response and document changes for chat jobs.
statusYesCurrent status: 'pending', 'in_progress', 'awaiting_approval', 'completed', 'failed', or 'cancelled'.
user_idNoUser that owns this job (null for organization jobs).
job_typeYesType of job: 'chat' (a chat_async turn), 'sync_chat' (a synchronous chat call; its result stays here if the call's connection ended), 'attachment_processing' (an attachment being read) or 'document_ingest' (process_uploaded_document loading a document; its result stays here if the call's connection ended).
metadataNoJob metadata and context. Contains pending_changes when status is 'awaiting_approval'.
progressYesProgress percentage (0-100).
created_atYesISO 8601 timestamp when the job was created.
session_idYesSession associated with this job.
updated_atYesISO 8601 timestamp of the last status change.
organization_idNoOrganization that owns this job (null for user jobs).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • removedInput schema / properties / authorization
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "title": "Authorization"
      -}
    • addedInput schema / properties / wait_seconds
      Added value: +{
      +  "default": 0,
      +  "description": "Optional: wait up to this many seconds (at most 110) for a pending or running job to settle before answering, so one call replaces a polling loop. 0 (default) answers at once.",
      +  "maximum": 110,
      +  "minimum": 0,
      +  "title": "Wait Seconds",
      +  "type": "integer"
      +}
    • changedOutput schema / properties / job_type / description
      Previous value: -"Type of job: 'chat' (a chat_async turn), 'sync_chat' (a synchronous chat call; its result stays here if the call's connection ended), 'attachment_processing' or 'attachment_upload'."New value: +"Type of job: 'chat' (a chat_async turn), 'sync_chat' (a synchronous chat call; its result stays here if the call's connection ended), 'attachment_processing' (an attachment being read) or 'document_ingest' (process_uploaded_document loading a document; its result stays here if the call's connection ended)."
  2. Changed1 schema field changed
    • changedOutput schema / properties / job_type / description
      Previous value: -"Type of job: 'chat' or 'attachment_processing'."New value: +"Type of job: 'chat' (a chat_async turn), 'sync_chat' (a synchronous chat call; its result stays here if the call's connection ended), 'attachment_processing' or 'attachment_upload'."
  3. First observed

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does most of it: it exposes the complete state machine (pending/in_progress/awaiting_approval/completed/failed/cancelled), explains that intermediate AI responses stream, and names the event types (documents_changed, continue_prompt, model_fallback, proposed_change_batch). It stops short of describing error behavior for an unknown or expired job_id, which is the one behavioral gap for a polling tool.

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?

Dense but well front-loaded: the first sentence states what comes back, the second tells the agent what to do with it, the third adds client-specific detail. No sentence is pure filler, though the SSE/intermediate-response clause is technical enough to slightly bloat a single-paragraph block that could be split by purpose.

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?

An output schema exists and the description redundantly restates return fields, but because it frames them as state-dependent payloads (HTML only once complete, pending changes only when awaiting approval) it adds orientation rather than just repeating types. The async-workflow loop — poll, detect awaiting_approval, approve, re-poll — is fully closed, leaving only error handling unaddressed.

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 67% and both optional params already carry detailed schema descriptions (compact's poll-compact-then-fetch-non-compact strategy, wait_seconds' long-poll semantics). The description adds no parameter-level detail of its own — it never mentions compact or wait_seconds — so it only marginally exceeds schema baseline.

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?

Opens with a specific verb+resource ('Returns the job's current state') and enumerates the exact resources returned: status, streamed intermediates, final document HTML, and pending changes. It also names the sibling it pairs with (chat_async) and the adjacent endpoint it is NOT for (doc-events), so an agent can place it precisely among the 30+ siblings.

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?

Explicit routing: 'Poll this after chat_async to track progress and retrieve results', then a conditional branch ('When status is awaiting_approval, call POST /v1/chat/{session_id}/approve'), then a scope exclusion ('cross-session document updates from OTHER sessions are reported separately by polling doc-events'). That is when/when-not/alternatives all present.

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.