Skip to main content
Glama

codex

Runs non-interactive AI coding sessions in a target workspace to debug root causes, review code, implement fixes, and refactor multi-file changes, reporting changed git files.

Instructions

Executes a non-interactive OpenAI Codex CLI session (including GPT-6.2 Astra) in a target workspace or git worktree.
Supports both Windows native execution and WSL bridging via environment variables, unattended approval policy,
session resumption (`SESSION_ID`), reasoning effort tuning, and git `changed_files` reporting.

**Best-Fit Tasks:**
    - Deep root-cause debugging and closed-loop test-fix cycles.
    - Cross-model code review (`sandbox="read-only"`) for concurrency, edge cases, invariants, and security.
    - High-logic / high-correctness implementation (algorithms, state machines, protocols, concurrency, data/backend logic).
    - Multi-file refactoring preserving strict invariants and comprehensive test coverage.

**Collaboration Best Practices:**
    - Always pass `cd` pointing to the active workspace or `/teamwork` git worktree root.
    - Use `sandbox="read-only"` for analysis/reviews and `sandbox="workspace-write"` for edits/fixes.
    - Reuse `SESSION_ID` on rework/follow-ups to preserve context and token cache.
    - Inspect `changed_files` in the response to verify scope before finalizing.

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>",
      "cd": "<cd>"
    },
    "name": "codex"
  }
}

Input Schema

NameRequiredDescriptionDefault
cdYes
yoloNoBypass all approvals and sandboxing (`--dangerously-bypass-approvals-and-sandbox`). Use only in isolated environments.
imageNoOptional list of image paths to attach to the prompt.
modelNoOptional model override (e.g. `gpt-6.2-astra`). When empty, uses `CODEX_DEFAULT_MODEL` or the user's `~/.codex/config.toml` default.
PROMPTYes
profileNo
sandboxNoSandbox policy (`read-only`, `workspace-write`, `danger-full-access`). When omitted, uses `CODEX_DEFAULT_SANDBOX` (fallback `read-only`).
SESSION_IDNo
timeout_secondsNoOptional execution timeout in seconds. Defaults to `CODEX_TIMEOUT_SECONDS` (600s).
reasoning_effortNoOptional reasoning effort override (`minimal`, `low`, `medium`, `high`, `xhigh`). When omitted, uses `CODEX_DEFAULT_REASONING_EFFORT` or Codex CLI default.
return_all_messagesNo
skip_git_repo_checkNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.8.0

TDQS

A3.8/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It usefully discloses non-interactive execution, WSL bridging, unattended approval policy, session resumption, sandbox modes, and changed-files reporting. However, it does not fully explain execution side effects, permission or approval implications of yolo/danger modes, timeout behavior, or token/cost implications.

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 well structured and front-loaded, with clear headings for best-fit tasks and collaboration practices. It is slightly long but every section contributes useful routing or operational guidance.

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

Completeness3/5

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

For a complex code-execution tool with 12 parameters and no annotations, the definition is helpful but incomplete. Output-schema presence means return values need not be explained, but the description should do more to cover risky parameters and execution-side behavior.

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 schema covers about half the parameters, and the description adds meaningful guidance for cd, SESSION_ID, and sandbox selection. It does not explain several important parameters such as PROMPT, yolo, image, model, profile, timeout_seconds, return_all_messages, or skip_git_repo_check, leaving noticeable gaps at 12 parameters.

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 first sentence states a specific verb and resource: executes a non-interactive OpenAI Codex CLI session in a workspace or git worktree. The best-fit tasks further clarify the intended scope, so an agent can distinguish this from an ordinary shell or editing tool.

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 gives concrete when-to-use guidance through best-fit tasks (debugging, read-only review, algorithm-heavy implementation, multi-file refactoring) and collaboration practices for sandbox selection. It lacks explicit when-not-to-use exclusions or named alternatives, which keeps it below a 5.

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

Deploy Server

Other Tools