Skip to main content
Glama

Check job status (free)

codex_job_status
Read-only

Check a background job's lifecycle state to see if a result is ready, whether it succeeded or stored a failure, and how long to wait before polling again—without fetching the full result.

Instructions

Check a background job's lifecycle state without fetching the full result.

Use after any *_async call (codex_delegate_async, codex_consult_async, codex_review_changes_async) or any sync consult/review/delegate (whose meta.job_id names its record). Returns status, elapsed time, expiry, and result_available; when it is true, call codex_job_result. result_ok reports a done job's producer-declared outcome — true (success), false (a stored error envelope), or null (running, no stored envelope, an unclassifiable payload, or a record finalized before this field) — so you can spot a stored FAILURE without fetching it. It does not guarantee the payload is still fetchable; a cross-release record may report an outcome yet fail codex_job_result with job_result_incompatible. Free — no model call.

Honor poll_after_ms between polls — for a running job it GROWS with elapsed runtime (bounded), so following it backs you off instead of tight-looping (a delegate often runs ~20s). expires_at is null while running and is set once the job finishes; results are then retained ttl_seconds past that completion.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
job_idYesThe job_id from an *_async call or a sync call's meta.job_id; recover lost ids with codex_job_list. Control characters are rejected, not stripped.
workspace_rootNoAbsolute path to the target repo root — pass it (or an MCP root) to target the intended repo; otherwise the call falls back to the server's own cwd and sets meta.workspace_warning. On an active call it selects where Codex works, not what it can read — it is not a read boundary.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed3 schema fields changedv0.19.0
    • changedInput schema / properties / job_id / description
      Previous value: -"The job_id from an *_async call or a sync call's meta.job_id; recover lost ids with codex_job_list."New value: +"The job_id from an *_async call or a sync call's meta.job_id; recover lost ids with codex_job_list. Control characters are rejected, not stripped."
    • addedInput schema / properties / job_id / pattern
      Added value: +"^[^\\x00-\\x1F\\x7F-\\x9F]*$"
    • changedInput schema / properties / workspace_root / description
      Previous value: -"Absolute path to the target repo root — pass it (or an MCP root) to target the intended repo; otherwise the call falls back to the server's own cwd and sets meta.workspace_warning."New value: +"Absolute path to the target repo root — pass it (or an MCP root) to target the intended repo; otherwise the call falls back to the server's own cwd and sets meta.workspace_warning. On an active call it selects where Codex works, not what it can read — it is not a read boundary."
  2. Changed2 schema fields changedv0.17.0
    • changedInput schema / properties / workspace_root / description
      Previous value: -"Absolute path to the target repository root. Pass it (or rely on an MCP root) so the call targets the intended repo; otherwise it falls back to the server's own cwd and meta.workspace_warning is set."New value: +"Absolute path to the target repo root — pass it (or an MCP root) to target the intended repo; otherwise the call falls back to the server's own cwd and sets meta.workspace_warning."
    • changedOutput schema / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "cleanup_warnings": {
      -        "items": {
      -          "type": "string"
      -        },
      -        "type": "array"
      -      },
      -      "deadline_seconds": {
      -        "type": "integer"
      -      },
      -      "detail": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ]
      -      },
      -      "elapsed_ms": {
      -        "type": "integer"
      -      },
      -      "event_age_ms": {
      -        "anyOf": [
      -          {
      -            "type": "integer"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ]
      -      },
      -      "events_seen": {
      -        "type": "integer"
      -      },
      -      "expires_at": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ]
      -      },
      -      "fingerprint": {
      -        "type": "string"
      -      },
      -      "job_id": {
      -        "type": "string"
      -      },
      -      "kind": {
      -        "type": "string"
      -      },
      -      "last_event_at": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ]
      -      },
      -      "ok": {
      -        "const": true,
      -        "type": "boolean"
      -      },
      -      "poll_after_ms": {
      -        "type": "integer"
      -      },
      -      "result_available": {
      -        "type": "boolean"
      -      },
      -      "server_version": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ]
      -      },
      -      "started_at": {
      -        "type": "string"
      -      },
      -      "status": {
      -        "enum": [
      -          "running",
      -          "done",
      -          "failed",
      -          "cancelled",
      -          "timeout"
      -        ],
      -        "type": "string"
      -      },
      -      "ttl_seconds": {
      -        "type": "integer"
      -      },
      -      "workspace": {
      -        "additionalProperties": false,
      -        "properties": {
      -          "cwd": {
      -            "type": "string"
      -          },
      -          "workspace_source": {
      -            "anyOf": [
      -              {
      -                "type": "string"
      -              },
      -              {
      -                "type": "null"
      -              }
      -            ]
      -          },
      -          "workspace_warning": {
      -            "anyOf": [
      -              {
      -                "type": "string"
      -              },
      -              {
      -                "type": "null"
      -              }
      -            ]
      -          }
      -        },
      -        "required": [
      -          "cwd"
      -        ],
      -        "type": "object"
      -      }
      -    },
      -    "required": [
      -      "job_id",
      -      "kind",
      -      "status",
      -      "started_at",
      -      "elapsed_ms",
      -      "deadline_seconds",
      -      "ttl_seconds",
      -      "workspace"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "properties": {
      -      "error": {
      -        "description": "Populated error envelope; full schema at resource codex://error-envelope",
      -        "type": "object"
      -      },
      -      "meta": {
      -        "type": "object"
      -      },
      -      "ok": {
      -        "const": false
      -      }
      -    },
      -    "required": [
      -      "ok",
      -      "error",
      -      "meta"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "cleanup_warnings": {
      +        "items": {
      +          "type": "string"
      +        },
      +        "type": "array"
      +      },
      +      "deadline_seconds": {
      +        "type": "integer"
      +      },
      +      "detail": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ]
      +      },
      +      "elapsed_ms": {
      +        "type": "integer"
      +      },
      +      "event_age_ms": {
      +        "anyOf": [
      +          {
      +            "type": "integer"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ]
      +      },
      +      "events_seen": {
      +        "type": "integer"
      +      },
      +      "expires_at": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ]
      +      },
      +      "fingerprint": {
      +        "type": "string"
      +      },
      +      "job_id": {
      +        "type": "string"
      +      },
      +      "kind": {
      +        "type": "string"
      +      },
      +      "last_event_at": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ]
      +      },
      +      "ok": {
      +        "const": true,
      +        "type": "boolean"
      +      },
      +      "poll_after_ms": {
      +        "type": "integer"
      +      },
      +      "result_available": {
      +        "type": "boolean"
      +      },
      +      "result_ok": {
      +        "anyOf": [
      +          {
      +            "type": "boolean"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ]
      +      },
      +      "server_version": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ]
      +      },
      +      "started_at": {
      +        "type": "string"
      +      },
      +      "status": {
      +        "enum": [
      +          "running",
      +          "done",
      +          "failed",
      +          "cancelled",
      +          "timeout"
      +        ],
      +        "type": "string"
      +      },
      +      "ttl_seconds": {
      +        "type": "integer"
      +      },
      +      "workspace": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "cwd": {
      +            "type": "string"
      +          },
      +          "workspace_source": {
      +            "anyOf": [
      +              {
      +                "type": "string"
      +              },
      +              {
      +                "type": "null"
      +              }
      +            ]
      +          },
      +          "workspace_warning": {
      +            "anyOf": [
      +              {
      +                "type": "string"
      +              },
      +              {
      +                "type": "null"
      +              }
      +            ]
      +          }
      +        },
      +        "required": [
      +          "cwd"
      +        ],
      +        "type": "object"
      +      }
      +    },
      +    "required": [
      +      "job_id",
      +      "kind",
      +      "status",
      +      "started_at",
      +      "elapsed_ms",
      +      "deadline_seconds",
      +      "ttl_seconds",
      +      "result_ok",
      +      "workspace"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "error": {
      +        "description": "Populated error envelope; full schema at resource codex://error-envelope",
      +        "type": "object"
      +      },
      +      "meta": {
      +        "type": "object"
      +      },
      +      "ok": {
      +        "const": false
      +      }
      +    },
      +    "required": [
      +      "ok",
      +      "error",
      +      "meta"
      +    ],
      +    "type": "object"
      +  }
      +]
  3. Changed1 schema field changedv0.11.0
    • changedOutput schema / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "cleanup_warnings": {
      -        "items": {
      -          "type": "string"
      -        },
      -        "type": "array"
      -      },
      -      "deadline_seconds": {
      -        "type": "integer"
      -      },
      -      "detail": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ]
      -      },
      -      "elapsed_ms": {
      -        "type": "integer"
      -      },
      -      "event_age_ms": {
      -        "anyOf": [
      -          {
      -            "type": "integer"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ]
      -      },
      -      "events_seen": {
      -        "type": "integer"
      -      },
      -      "expires_at": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ]
      -      },
      -      "fingerprint": {
      -        "type": "string"
      -      },
      -      "job_id": {
      -        "type": "string"
      -      },
      -      "kind": {
      -        "type": "string"
      -      },
      -      "last_event_at": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ]
      -      },
      -      "ok": {
      -        "const": true,
      -        "type": "boolean"
      -      },
      -      "poll_after_ms": {
      -        "type": "integer"
      -      },
      -      "result_available": {
      -        "type": "boolean"
      -      },
      -      "started_at": {
      -        "type": "string"
      -      },
      -      "status": {
      -        "enum": [
      -          "running",
      -          "done",
      -          "failed",
      -          "cancelled",
      -          "timeout"
      -        ],
      -        "type": "string"
      -      },
      -      "ttl_seconds": {
      -        "type": "integer"
      -      },
      -      "workspace": {
      -        "additionalProperties": false,
      -        "properties": {
      -          "cwd": {
      -            "type": "string"
      -          },
      -          "workspace_source": {
      -            "anyOf": [
      -              {
      -                "type": "string"
      -              },
      -              {
      -                "type": "null"
      -              }
      -            ]
      -          },
      -          "workspace_warning": {
      -            "anyOf": [
      -              {
      -                "type": "string"
      -              },
      -              {
      -                "type": "null"
      -              }
      -            ]
      -          }
      -        },
      -        "required": [
      -          "cwd"
      -        ],
      -        "type": "object"
      -      }
      -    },
      -    "required": [
      -      "job_id",
      -      "kind",
      -      "status",
      -      "started_at",
      -      "elapsed_ms",
      -      "deadline_seconds",
      -      "ttl_seconds",
      -      "workspace"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "properties": {
      -      "error": {
      -        "description": "Populated error envelope; full schema at resource codex://error-envelope",
      -        "type": "object"
      -      },
      -      "meta": {
      -        "type": "object"
      -      },
      -      "ok": {
      -        "const": false
      -      }
      -    },
      -    "required": [
      -      "ok",
      -      "error",
      -      "meta"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "cleanup_warnings": {
      +        "items": {
      +          "type": "string"
      +        },
      +        "type": "array"
      +      },
      +      "deadline_seconds": {
      +        "type": "integer"
      +      },
      +      "detail": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ]
      +      },
      +      "elapsed_ms": {
      +        "type": "integer"
      +      },
      +      "event_age_ms": {
      +        "anyOf": [
      +          {
      +            "type": "integer"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ]
      +      },
      +      "events_seen": {
      +        "type": "integer"
      +      },
      +      "expires_at": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ]
      +      },
      +      "fingerprint": {
      +        "type": "string"
      +      },
      +      "job_id": {
      +        "type": "string"
      +      },
      +      "kind": {
      +        "type": "string"
      +      },
      +      "last_event_at": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ]
      +      },
      +      "ok": {
      +        "const": true,
      +        "type": "boolean"
      +      },
      +      "poll_after_ms": {
      +        "type": "integer"
      +      },
      +      "result_available": {
      +        "type": "boolean"
      +      },
      +      "server_version": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ]
      +      },
      +      "started_at": {
      +        "type": "string"
      +      },
      +      "status": {
      +        "enum": [
      +          "running",
      +          "done",
      +          "failed",
      +          "cancelled",
      +          "timeout"
      +        ],
      +        "type": "string"
      +      },
      +      "ttl_seconds": {
      +        "type": "integer"
      +      },
      +      "workspace": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "cwd": {
      +            "type": "string"
      +          },
      +          "workspace_source": {
      +            "anyOf": [
      +              {
      +                "type": "string"
      +              },
      +              {
      +                "type": "null"
      +              }
      +            ]
      +          },
      +          "workspace_warning": {
      +            "anyOf": [
      +              {
      +                "type": "string"
      +              },
      +              {
      +                "type": "null"
      +              }
      +            ]
      +          }
      +        },
      +        "required": [
      +          "cwd"
      +        ],
      +        "type": "object"
      +      }
      +    },
      +    "required": [
      +      "job_id",
      +      "kind",
      +      "status",
      +      "started_at",
      +      "elapsed_ms",
      +      "deadline_seconds",
      +      "ttl_seconds",
      +      "workspace"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "error": {
      +        "description": "Populated error envelope; full schema at resource codex://error-envelope",
      +        "type": "object"
      +      },
      +      "meta": {
      +        "type": "object"
      +      },
      +      "ok": {
      +        "const": false
      +      }
      +    },
      +    "required": [
      +      "ok",
      +      "error",
      +      "meta"
      +    ],
      +    "type": "object"
      +  }
      +]
  4. Changed2 schema fields changedv0.8.0
    • changedInput schema / properties / job_id / description
      Previous value: -"The job_id returned by an *_async call (codex_*_async); recover lost ids with codex_job_list."New value: +"The job_id from an *_async call or a sync call's meta.job_id; recover lost ids with codex_job_list."
    • addedOutput schema / $schema
      Added value: +"https://json-schema.org/draft/2020-12/schema"
  5. First observedv0.5.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only declare readOnlyHint=true and openWorldHint=false, which the description respects. It goes beyond annotations by disclosing nuances: result_ok behavior (true/false/null), the possibility that payloads may not be fetchable despite an outcome, the growing poll_after_ms with backoff rationale, and expires_at being null while running. It also flags the job_result_incompatible risk and the free/no-model-call nature. This is exemplary transparency.

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 dense but well-organized: it front-loads the primary purpose and usage, then clarifies result_ok and polling. Some redundancy exists with the schema (e.g., workspace_root details), but each paragraph contributes unique operational guidance. It is longer than minimal but 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 tool's moderate complexity (2 params, output schema present), the description covers all critical aspects: when to use, what to expect (result_ok, poll_after_ms, expires_at), and caveats (stored failure detection, fetch failure). The presence of an output schema reduces the need to document return fields, and the description complements it with lifecycle behavior. Nothing essential is missing.

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?

The input schema already covers both parameters with rich descriptions (e.g., job_id's pattern and workspace_root's semantics). The description adds context on how to use job_id (from async or sync calls) and reiterates poll_after_ms behavior, but it does not add new syntax details beyond the schema. Since schema coverage is 100%, baseline 3 is appropriate.

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 clearly states the tool's verb ('Check'), resource ('a background job's lifecycle state'), and scope ('without fetching the full result'). It explicitly distinguishes itself from codex_job_result by specifying that it returns status, not the full result, and from siblings by naming the async/sync call types that produce the job_id.

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?

It provides explicit when-to-use guidance ('Use after any *_async call... or any sync consult/review/delegate'), and enumerates the exact sibling tools that produce job_id. It also directs the agent to call codex_job_result when result_available is true, and mentions codex_job_list for recovering lost ids. This is thorough and actionable.

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

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/briandconnelly/codex-in-claude'

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