Skip to main content
Glama

Get Image Job

get_image_job
Read-onlyIdempotent

Poll a backgrounded image generation job using its job_id to get generated files, model settings, usage, and cost when finished.

Instructions

Poll a backgrounded gpt-image job: every image tool (generate_image, edit_image, start_edit_session, continue_edit_session) hands off immediately and returns a job_id rather than blocking past MCP client timeouts. Call this with that job_id until state becomes "completed" (files are already written to disk and returned inline, with the model, requested/applied settings, usage, and cost) or "failed". While still "running", wait a few seconds between polls.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
job_idYesThe job_id returned by generate_image / edit_image when they moved the work to the background.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
toolYes
turnNo
errorYes
modelNo
notesNo
routeNo
stateYes
usageNo
imagesNoWritten image files — present once the job completed successfully.
job_idYes
promptNo
appliedNo
poll_hintNoPresent while a job is still running.
requestedNo
elapsed_msYes
session_idNo
started_atYes
completed_atYes
prompt_previewYes
cost_usd_estimatedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed11 schema fields changedv0.5.5
    • addedOutput schema / properties / applied
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "background": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "output_format": {
      +      "type": "string"
      +    },
      +    "quality": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "size": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    }
      +  },
      +  "required": [
      +    "output_format"
      +  ],
      +  "type": "object"
      +}
    • addedOutput schema / properties / cost_usd_estimated
      Added value: +{
      +  "type": [
      +    "number",
      +    "null"
      +  ]
      +}
    • addedOutput schema / properties / model
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / notes
      Added value: +{
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / poll_hint
      Added value: +{
      +  "description": "Present while a job is still running.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / prompt
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / requested
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "format": {
      +      "type": "string"
      +    },
      +    "n": {
      +      "type": "number"
      +    },
      +    "quality": {
      +      "type": "string"
      +    },
      +    "size": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "size",
      +    "quality",
      +    "n",
      +    "format"
      +  ],
      +  "type": "object"
      +}
    • addedOutput schema / properties / route
      Added value: +{
      +  "enum": [
      +    "direct",
      +    "responses"
      +  ],
      +  "type": "string"
      +}
    • addedOutput schema / properties / session_id
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / turn
      Added value: +{
      +  "type": "number"
      +}
    • addedOutput schema / properties / usage
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": false,
      +      "properties": {
      +        "input_tokens": {
      +          "type": "number"
      +        },
      +        "input_tokens_details": {
      +          "additionalProperties": false,
      +          "properties": {
      +            "image_tokens": {
      +              "type": "number"
      +            },
      +            "text_tokens": {
      +              "type": "number"
      +            }
      +          },
      +          "type": "object"
      +        },
      +        "output_tokens": {
      +          "type": "number"
      +        },
      +        "output_tokens_details": {
      +          "additionalProperties": false,
      +          "properties": {
      +            "image_tokens": {
      +              "type": "number"
      +            },
      +            "text_tokens": {
      +              "type": "number"
      +            }
      +          },
      +          "type": "object"
      +        },
      +        "total_tokens": {
      +          "type": "number"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ]
      +}
  2. First observedv0.3.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare readOnly, idempotent, and non-destructive behavior. The description adds valuable traits beyond annotations: it explains the non-blocking handoff, the possible states ('running', 'completed', 'failed'), and that completed jobs have files written to disk and returned inline with model, settings, usage, and cost. This is exactly the behavioral context an agent needs.

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?

The description is compact but complete: it front-loads the core polling action, explains why it exists, states the terminal states, and gives the polling cadence in three sentences. Every sentence earns its place.

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 single-parameter polling tool with a rich description and output schema, nothing essential is missing. It explains the backgrounding context, how to poll, what terminal states mean, what completed results contain, and how long to wait between polls. The presence of an output schema also relieves the description of needing to document return structure in detail.

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?

Schema description coverage is 100%, so the baseline is 3. The description adds meaning beyond the schema by noting that job_id is returned by every image tool, including start_edit_session and continue_edit_session, whereas the schema only mentions generate_image and edit_image. This extends the agent's understanding of valid job_id provenance.

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 a specific verb and resource ('Poll a backgrounded gpt-image job') and clearly distinguishes this tool from the image-generation tools that create the job_id. It also names the exact sibling tools that return job_ids, so the agent can select this polling tool without opening schemas.

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 gives explicit when-to-use guidance: call this with a job_id after any image tool hands off, poll until 'completed' or 'failed', and wait a few seconds between polls. It does not explicitly contrast with list_image_jobs or state when not to use it, but the polling context is clear enough to guide correct usage.

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