Skip to main content
Glama

Execute a task with Codex

codex_execute

Initialize a session to run a task or plan in a workspace, providing a session ID, agent messages, file modifications, and executed commands.

Instructions

Start a new Codex session that executes a plan/task in the given workspace. Returns sessionId (keep it to send review feedback later), agent message, file changes and commands run.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdYesAbsolute path of the workspace Codex should work in
modelNoCodex model override, e.g. gpt-5.1-codex
promptYesTask or plan for Codex to execute (can embed full plan text)
sandboxNoCodex sandbox policy (default: workspace-write)workspace-write
terminalNoOpen a Terminal window streaming live progress (default: env CODEX_MCP_TERMINAL=1)
timeoutMsNoMax execution time in ms (default: 30 minutes)
Behavior3/5

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

With no annotations, the description must convey behavior. It mentions returning sessionId for later feedback and includes sandbox policy parameter, but does not explain execution risks, authorization, or rate limits. Some transparency but insufficient for a tool with destructive potential.

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?

Two sentences, front-loaded with purpose and return values. Efficient but could be sharper; the reminder about sessionId could be moved to parameter description.

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 6 parameters, no output schema, and sibling tools, the description covers core function but omits when-to-use details, parameter interactions, and sandbox implications. Adequate but leaves gaps.

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 coverage is 100% (all 6 parameters described), so description adds no extra meaning. Baseline of 3 applies as description does not compensate with additional context.

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?

Description clearly states the tool starts a new Codex session, executes a plan/task in a workspace, and lists key outputs (sessionId, agent message, file changes, commands). This distinguishes it from siblings like codex_continue (which likely continues an existing session).

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 use when initiating a new task but does not explicitly compare with siblings or state when not to use. It lacks guidance on selecting this over codex_continue or codex_review.

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/anhnguyen0905/codex-mcp'

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