Skip to main content
Glama
antigravity-codex-mcp
by Sunlazys

codex_run

Start an asynchronous Codex CLI session to execute coding prompts in a specified working directory and return a job ID for polling; optionally wait up to 55 seconds for completion.

Instructions

Start a new asynchronous Codex CLI session (codex exec --json). Returns a job_id immediately (or waits up to wait_seconds <= 55s).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "prompt": "<prompt>",
      "cwd": "<cwd>"
    },
    "name": "codex_run"
  }
}

Input Schema

NameRequiredDescriptionDefault
cwdYesAbsolute path to the working directory.
modelNoOptional Codex model override (-m).
imagesNoOptional image file paths (-i).
promptYesInstructions sent to Codex via stdin.
profileNoOptional Codex config profile (-p).
sandboxNoCodex sandbox mode (-s).
wait_secondsNoOptional bounded wait (0..55 seconds) before returning.
output_schemaNoOptional JSON Schema enforced on final output.
max_duration_secNoJob timeout in seconds (default 900).
reasoning_effortNoOptional Codex reasoning effort override (-c model_reasoning_effort=..., e.g. low, medium, high, xhigh).
skip_git_repo_checkNoAllow running outside a Git repository.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A3.5/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full burden. It does disclose the key behavioral trait - immediate return of a job_id with an optional bounded wait capped at 55s - but says nothing about the fact that it spawns an executing coding agent on a real working directory, the implications of the danger-full-access sandbox option, concurrency limits, or how the job's output is later retrieved.

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?

Two short sentences, front-loaded with the action and followed by the return contract and wait bound. No filler, no redundant restatement of the tool name.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With 11 parameters, nested options, sandbox modes and no output schema, the description is thin: it never explains what a job_id is used for next, whether jobs persist, or how the result is fetched. An agent can call it correctly but cannot complete the workflow from this definition alone.

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 schema already documents all 11 parameters including the sandbox enum and the 0..55 wait_seconds bound. The description only echoes the wait_seconds ceiling, which the schema's maximum already encodes, so it adds essentially nothing beyond the structured data; the baseline for a fully documented schema applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb + resource ("Start a new asynchronous Codex CLI session") and even names the underlying command form (`codex exec --json`), so the agent knows exactly what is created. It does not name a sibling, but "Start ... asynchronous" plus the immediate job_id return implicitly separates it from codex_resume, codex_poll and codex_result.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage by explaining the async-or-bounded-wait tradeoff, which tells the agent how to use the tool once selected. It never says when to pick this over codex_resume or codex_fork, nor that the returned job should subsequently be driven through codex_poll / codex_result.

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