Skip to main content
Glama
Goudu666
by Goudu666

Run a Codex task

codex_run

Delegate a coding task to OpenAI Codex, starting or resuming a thread; it waits, then returns status, the agent's message, changed files, and commands run.

Instructions

Give Codex (OpenAI coding agent) a task. Starts a new thread, or continues an existing one when thread_id is given. Blocks up to wait_seconds, then returns status, Codex's latest message, files changed and commands run. status "inProgress" → codex_wait; "waitingForInput" → answer pending_requests with codex_respond. Run several threads in parallel by calling codex_run with wait_seconds: 0 for each, then codex_wait with all thread_ids. Review Codex's changes yourself before reporting them as done.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdNoAbsolute working directory. Required for a new thread.
modelNoModel override (see codex_models). Defaults to Codex config.
effortNoReasoning effort override, e.g. low | medium | high | xhigh (see codex_models).
promptYesInstructions for Codex. Be specific: goal, files, constraints, what "done" looks like.
sandboxNoSandbox for a new (or resumed) thread; fixed after that. Default: workspace-write.
approvalNoWhen Codex must ask before acting; can change between turns. "never" auto-approves everything. Default: on-request.
worktreeNoNew thread only: run in a fresh git worktree + branch (codex/<stamp>) of cwd's repo, so parallel tasks never collide. The worktree is kept for you to inspect/merge.
thread_idNoContinue this existing Codex thread (keeps its context).
web_searchNoNew thread only: enable live web search for Codex.
wait_secondsNoSeconds to block before returning a progress snapshot (default 240). Returns early when the turn finishes or Codex needs an answer. The turn keeps running after this returns.
output_schemaNoJSON Schema the final message must follow (structured output).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.5/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 well: it discloses the blocking model (blocks up to wait_seconds, returns early on completion or input request), that the turn keeps running after return, and exactly what is returned (status, latest message, files changed, commands run). It does not surface sandbox/approval safety implications or that sandbox is fixed per thread, but those live in the schema descriptions.

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?

Dense but front-loaded: the core action comes first, followed by mode selection, return contract, status routing, and the parallel recipe. Every sentence is actionable and none is filler.

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 complex 11-parameter orchestration tool with no output schema, the description fully covers the call/return/continue loop an agent needs, including the return payload and the follow-up tool for each status. Nothing required to drive the multi-step workflow correctly 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?

Schema description coverage is 100%, so all 11 parameters are already documented. The description adds a little meaning to thread_id (keeps context) and wait_seconds (returns early, turn keeps running), but largely restates what the schema provides; baseline 3 is appropriate when the schema does the heavy lifting.

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?

States a specific verb and resource ("Give Codex a task") and immediately distinguishes the two modes (new thread vs. continuing via thread_id). It routes to named siblings codex_wait and codex_respond, so an agent can tell it apart from the other codex_* tools without opening a schema.

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 when-to-use routing: status "inProgress" → codex_wait, "waitingForInput" → codex_respond, plus a concrete parallelization recipe (call with wait_seconds: 0, then codex_wait with all thread_ids). It also names when to use thread_id (continuing an existing thread) and adds a self-review caveat.

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