Skip to main content
Glama

codex

Destructive

Runs a terminal coding agent that reads and edits files to implement, refactor, or fix code, then returns the output.

Instructions

OpenAI Codex — a terminal coding agent (GPT/o-series) that autonomously reads and edits files to implement, refactor, and fix code. Runs the codex CLI non-interactively in cwd — it can read and edit files there and may take time or use the agent's own model quota — and returns its output. On common failures returns a classified, actionable error (not installed / not authenticated with the exact login command / not configured / timed out / busy / output-limit); other non-zero exits return a clipped stderr/stdout tail. Check availability with list_agents first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdNoWorking directory for the CLI. Prefer an absolute path; a relative path resolves from the server process's cwd. Not a sandbox — the agent may read/edit any files it can access.
modelNoOptional model id passed through to the CLI, overriding that CLI's configured/default model (e.g. "o3"). Model names are agent-specific. Must match [A-Za-z0-9][A-Za-z0-9._:/-]{0,127} — a flag-shaped value is rejected.
promptYesThe task or question for the agent, in natural language.
timeoutMsNoTotal runtime cap in milliseconds — the hard upper bound on the whole run once the CLI starts (excludes time queued behind the concurrency limit); the process group is killed if exceeded (default 1800000 = 30 minutes).
idleTimeoutMsNoIdle/inactivity timeout in milliseconds — the run is killed only if the agent produces NO output for this long (the timer resets on each output chunk; default 300000 = 5 minutes).
Behavior5/5

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

Annotations already flag destructive and open-world behavior, but the description adds rich context: non-interactive execution, ability to read/edit any accessible files (not sandboxed), time/model quota usage, classified failure modes, and clipped stderr/stdout on non-zero exits. 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.

Conciseness5/5

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

Three dense sentences: purpose, execution behavior, failure handling, and availability check. Information is front-loaded with tool identity, and every sentence earns its place 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?

Despite no output schema, the description covers success output ('returns its output'), failure classification, and operational caveats. Combined with strong schema and annotations, the tool is fully specified for an agent to use safely.

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?

All 5 parameters have detailed schema descriptions (100% coverage) covering cwd resolution, model override validation, and timeout semantics. The description itself adds no extra parameter detail, so the baseline 3 applies.

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: 'Runs the codex CLI non-interactively in cwd' and explains it 'autonomously reads and edits files to implement, refactor, and fix code.' This clearly distinguishes it from siblings like claude and run_all by naming the specific agent and its function.

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?

It explicitly instructs to 'Check availability with list_agents first' and clearly implies when to use: when you need OpenAI Codex to autonomously work on code. It does not explicitly compare to claude or run_all, but the use case is clear enough.

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/blackaxgit/agent-mcp-hub'

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