Skip to main content
Glama

codex_delegate_async

Trigger a background coding task with Codex. Get a job ID instantly to poll for results, keeping your workflow unblocked.

Instructions

Delegate a coding task to Codex in the background and get a job_id back immediately (does not block on the run).

Same propose-tier behavior as codex_delegate — Codex works in a throwaway git worktree and the result carries a reviewable diff that is NOT applied — but it runs detached. Starting a job commits to spend (it runs to completion or its wall-clock deadline even if you never poll). Poll with codex_job_status, read with codex_job_result, delete after successful read with codex_job_consume_result, or stop with codex_job_cancel. Requires a git repo with at least one commit; pass workspace_root (absolute).

NO NETWORK: like codex_delegate, this runs under workspace-write, which blocks network egress for commands Codex RUNS in the sandbox — the task must be self-contained (no push/fetch/gh/curl/publish/dependency install; those fail with a DNS/host-resolution error in the sandbox). This does NOT mean nothing leaves the machine: the Codex model call still sends your task (raw) to OpenAI and lets Codex read tracked files in the worktree and send their content — including the tracked AGENTS.md and .agents/skills/ skills, which auto-load in the worktree. Secret redaction is best-effort and does not cover your task or files Codex reads itself.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskYesThe coding task for Codex to implement inside a throwaway git worktree; the resulting diff is returned for review, not applied to your tree.
modelNoOverride the Codex model slug for this call; defaults to the server/Codex default when unset.
isolationNoCodex config isolation: 'inherit', 'ignore-config', or 'ignore-rules'. Defaults to the server's configured isolation (built-in default 'inherit'; `codex_status` reports the resolved value).
workspace_rootNoAbsolute 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.
idempotency_keyNoOptional client-supplied dedup key, scoped to THIS concrete tool on the same workspace. Reusing it on the same tool with the same arguments replays the existing run instead of starting — and paying for — a duplicate Codex call (a sync call reattaches to the in-flight run and returns its result; an _async call returns the same job_id). The sync and _async variants are DIFFERENT tools and never share a key's run. Reuse with different arguments — including a different timeout_seconds — is refused (idempotency_conflict); a key whose prior result was already consumed/evicted is idempotency_result_unavailable; a still-publishing reservation is idempotency_in_progress (retry). Omit it for the prior no-dedup behavior. A completed result stays replayable while its job record lives (its TTL), subject to consumption or count-eviction; the fail-closed conflict/in-progress window can last longer — up to the job's max runtime + termination grace + TTL. meta.idempotency_replayed=true marks a replayed (unpaid) response.
reasoning_effortNoOverride the Codex reasoning effort for this call (sent as a `model_reasoning_effort` config 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 Codex backend validates at run time — commonly minimal|low|medium|high|xhigh; codex_models lists each model's advertised set (advisory). A backend-rejected value fails as invalid_reasoning_effort; an explicit empty string is sent as-is (and rejected by the backend), never treated as unset. Control characters, surrogates, and values over 128 chars are rejected as invalid_arguments.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
Behavior5/5

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

The description discloses behavioral traits far beyond the sparse annotations. It explains async behavior, cost commitment, polling lifecycle, network sandbox limitations, auto-loading of AGENTS.md and skills, and best-effort secret redaction. It also details idempotency_key semantics. There is no contradiction with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is detailed but somewhat verbose, spanning multiple paragraphs. While well-structured and front-loaded with the main purpose, some sections (e.g., NO NETWORK explanation) could be more concise. It is informative but may overwhelm agents with 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?

The description is comprehensive for a complex tool with 6 parameters and an output schema. It covers workflow, prerequisites, lifecycle, network constraints, config auto-loading, and idempotency. The output schema exists, so return values need not be detailed. No gaps are evident.

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?

The input schema has 100% coverage, so parameters are already well-described. The description adds extra context for idempotency_key (detailed dedup logic) and workspace_root (prerequisite), going beyond schema descriptions. Other parameters like task and isolation are not elaborated further, but the schema already suffices.

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 purpose: 'Delegate a coding task to Codex in the background and get a job_id back immediately (does not block on the run).' It uses a specific verb ('delegate') and resource ('coding task'), and distinguishes itself from the synchronous sibling codex_delegate by emphasizing the asynchronous detached execution.

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 context on when to use this tool vs. alternatives: it contrasts with codex_delegate (sync vs async) and lists polling tools. It also specifies prerequisites (git repo with commit, workspace_root) and warns about network restrictions. However, it does not explicitly compare with codex_consult or other siblings, and the decision guidance is implied rather than explicitly stated.

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