Skip to main content
Glama

Consult Codex in background (paid)

codex_consult_async

Avoid blocking on long codebase questions: launch a background Codex consult, get a job_id, and poll for the read-only answer.

Instructions

Ask Codex for a read-only second opinion in the background; get a job_id back immediately instead of blocking.

PAID — this spends Codex quota on every new call; there is no dry-run preview for a consult, so run codex_status (free) first to confirm the CLI is installed and authenticated.

Same read-only behavior as codex_consult (Codex never edits files), but detached — prefer it for a high-reasoning_effort or broad repo-grounded consult that can exceed the synchronous deadline (built-in default 300s), since a sync run whose deadline expires loses its partial work; this job's own deadline is separately configured (built-in default 1800s). Starting a job commits to spend (it runs to completion or its wall-clock deadline even if you never poll). Poll codex_job_status; read/consume the consult envelope with codex_job_result/codex_job_consume_result; stop with codex_job_cancel.

Data egress: same as codex_consult — sends your question and extra_context (raw, unredacted) to OpenAI via the codex CLI, plus files Codex reads from its resolved working directory (workspace_root, your MCP roots, or the server cwd). Codex auto-loads the resolved workspace's AGENTS.md and discovers skills in its .agents/skills/ and user-global $CODEX_HOME/skills/ (default ~/.codex/skills/), reachable from outside the workspace.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelNoOverride the Codex model slug for this call; defaults to the server/Codex default when unset.
questionYesThe question or prompt to send Codex (a different model) for a read-only answer. Must be non-blank: empty or whitespace-only is rejected before any model call.
isolationNoCodex config isolation: 'inherit' | 'ignore-config' | 'ignore-rules'. Defaults to the server's configured value (built-in 'inherit'; `codex_status` reports the resolved one).
extra_contextNoOptional author intent/background context, added as clearly-labeled UNTRUSTED prompt data. Redaction does NOT cover it — no live secrets. Full caveats and bounds: codex://params.
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.
idempotency_keyNoOptional dedup key scoped to THIS tool + workspace. Same key + same args replays the prior result with no new spend; different args are refused (idempotency_conflict). Sync and _async are separate tools and never share a key. Omit for none; retention is bounded. Lifecycle: codex://params.
reasoning_effortNoOverride the Codex reasoning effort for this call (a model_reasoning_effort override); omit or pass null for the server default (CODEX_IN_CLAUDE_REASONING_EFFORT) or Codex's own resolution. An open, per-model string the backend validates at run time — commonly minimal|low|medium|high|xhigh; codex_models lists each model's advertised set (advisory). Rejection and bounds detail: codex://params.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
Behavior5/5

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

Beyond the annotations, the description discloses that the call is paid, consumes Codex quota, has no dry-run preview, runs to completion even if never polled, has a configurable deadline, never edits files, and sends raw unredacted `question`/`extra_context` to OpenAI. It also explains workspace-root resolution, AGENTS.md auto-loading, and skill discovery—far exceeding the annotation-provided hints.

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 dense but front-loaded: the first sentence states the core purpose and immediate return value, followed by a clear PAID warning, a comparison to the sync sibling, job lifecycle steps, and data-egress caveats. Every sentence provides operationally relevant detail without fluff.

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 complexity, the description fully covers purpose, usage guidance, pricing, side effects, job lifecycle, parameter caveats, workspace behavior, and data egress. The presence of an output schema makes the lack of explicit return-value explanation acceptable; the description is complete for an agent to select and invoke safely.

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

Parameters5/5

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

Although the schema already covers all parameters at 100%, the description adds meaningful semantic nuance: `extra_context` is labeled UNTRUSTED and not redacted, `workspace_root` fallback triggers `meta.workspace_warning`, and `idempotency_key` replays results with no new spend only when key and args match. These details go well beyond the field descriptions.

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 opens with a specific verb+resource: 'Ask Codex for a read-only second opinion in the background' and states the immediate return of a `job_id`. It clearly distinguishes from the synchronous sibling `codex_consult` by noting it is 'detached' and better for long-running, high-reasoning_effort or broad repo-grounded consults.

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?

The description explicitly says to prefer this tool over `codex_consult` when the sync deadline may be exceeded, warns that sync runs lose partial work, and instructs running `codex_status` first because there is no dry-run. It also names the exact lifecycle tools: `codex_job_status`, `codex_job_result`, `codex_job_consume_result`, and `codex_job_cancel`.

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

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