Skip to main content
Glama

codex_run

Run the Codex coding agent non-interactively to handle tasks like code reviews, edits, and diagnostics with custom prompts, sandbox policies, and CLI controls.

Instructions

Run the Codex agent non-interactively (codex exec) with common CLI controls.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cdNoDirectory codex should treat as its working root (--cd).
cwdNoWorking directory for the codex process.
envNoAdditional environment variables for codex.
modelNoModel the agent should use. May be forced by the server's model-override environment variable.
imagesNoImage file paths to attach to the prompt.
promptYesTask for the Codex agent.
addDirsNoAdditional directories to expose to the agent (--add-dir).
sandboxNoSandbox policy for model-generated shell commands.
ephemeralNoSkip persisting session files to disk. Defaults to true.
extraArgsNoAdditional raw codex CLI arguments appended to the command.
timeoutMsNoProcess timeout in milliseconds.
ignoreRulesNoDo not load user or project execpolicy .rules files.
approveForMeNoRoute approval requests through automatic review using the workspace-write sandbox.
outputSchemaNoPath to a JSON Schema file describing the expected final response shape.
skipGitRepoCheckNoAllow running outside a Git repository. Defaults to true.
outputLastMessageNoPath to a file where the final agent message should be written.
dangerouslyBypassApprovalsAndSandboxNoSkip all confirmation prompts and sandboxing. Only use in an already-isolated environment.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations, the description carries the burden of behavioral disclosure. It discloses that the tool runs non-interactively and exposes 'common CLI controls', but it does not mention side effects like file modifications, sandbox behavior, approval routing, or the fact that `dangerouslyBypassApprovalsAndSandbox` exists. The schema provides some parameter-level behavior, but the description itself adds minimal behavioral context beyond the mode of execution.

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 a single sentence that is concise and front-loads the core purpose. It could add a bit more context about when to use it, but it is not bloated and every word earns its place.

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?

Given the tool's complexity (17 parameters, no output schema, no annotations), the description is thin. It doesn't explain return values, side effects, or how the tool relates to codex_raw and codex_review. The schema covers parameters, but the description doesn't provide enough operational context for an agent to know what happens when the tool runs or what the output will look like.

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 the schema already documents all 17 parameters. The description adds no parameter-level meaning beyond what the schema provides. Baseline 3 is appropriate because the schema does the heavy lifting and the description doesn't need to compensate.

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?

The description states a specific verb ('Run'), a specific resource ('the Codex agent'), and the mode ('non-interactively (`codex exec`)'), which clearly distinguishes it from interactive or review-oriented siblings. It doesn't explicitly name sibling alternatives, but the mention of `codex exec` and 'common CLI controls' gives enough specificity to separate it from codex_review, codex_resume, and codex_raw.

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: run the Codex agent non-interactively with CLI controls. It does not explicitly state when to use this tool versus codex_raw, codex_review, or codex_resume. The phrase 'common CLI controls' hints that codex_raw is for raw/advanced usage, but no explicit when/when-not guidance is provided.

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