Skip to main content
Glama

Ask Codex (OpenAI, ChatGPT subscription)

codex_ask
Destructive

Send a prompt to Codex and receive its response, with optional sandboxed file editing and shell command execution. Use a thread ID to continue conversations or run parallel queries.

Instructions

Send a prompt to OpenAI Codex and get its response back. Codex can, if sandbox_mode is set to workspace-write, actually run shell commands and edit files under working_directory — not just answer in text. Pass the thread_id from a prior call to continue that conversation; omit it to start a fresh one. Independent calls (different or omitted thread_id) run concurrently as separate Codex conversations, so this can be used for many parallel queries as well as a single ongoing one.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelNoOverride the Codex model (defaults to the CLI's configured default).
promptYesThe instruction or question to send to Codex.
thread_idNoThread id returned by a previous codex_ask call. Pass it to continue that conversation with full prior context. Omit to start a new thread.
timeout_msNoAbort the turn if it runs longer than this many milliseconds.
web_searchNoEnable Codex's own live web search tool for this turn.
sandbox_modeNoread-only: Codex can inspect files and run non-mutating commands, but cannot write files or run arbitrary commands. workspace-write: Codex may edit files and run commands within working_directory (+ additional_directories). danger-full-access: no sandboxing at all. Default read-only.read-only
output_schemaNoJSON Schema the final response must conform to (structured output).
network_accessNoOnly relevant when sandbox_mode is workspace-write: allow shell commands to reach the network.
approval_policyNoCodex's approval policy for actions outside the sandbox. Since this runs non-interactively there is no one to answer an approval prompt, so anything requiring escalation beyond sandbox_mode is simply denied regardless of this setting. Default never.never
reasoning_effortNoOverride the model's reasoning effort.
require_git_repoNoIf true, Codex refuses to run when working_directory is not inside a git repository, instead of skipping that check.
working_directoryYesAbsolute path Codex should treat as its working root (e.g. C:\path\to\repo). Required — there is no implicit default, to avoid Codex silently operating on the wrong directory.
additional_directoriesNoExtra absolute paths Codex may read/write beyond working_directory.
Behavior5/5

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

The description exceeds the annotations by disclosing that Codex can run shell commands and edit files when sandbox_mode is workspace-write, and that calls with different/omitted thread_id run concurrently. This adds operational context beyond the simple readOnly/destructive hints and aligns with the annotations, showing no contradiction.

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?

The description is compact—three sentences—with the most important information front-loaded: the core action, followed by key behavioral caveats. No redundant or filler content.

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

Completeness4/5

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

Given the tool's complexity (13 parameters) and rich schema, the description covers the essential behavioral aspects: prompt sending, thread continuity, concurrency, and file-edit capability. It doesn't describe the response format, but without an output schema and with detailed parameter docs, this is acceptable.

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?

The schema already documents all 13 parameters with 100% coverage, so the baseline is 3. The description adds value by explaining concurrency behavior and the practical effect of sandbox_mode, which complements the schema though most param details are already covered.

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 ('Send a prompt to OpenAI Codex') and clearly explains the tool's scope, including its ability to execute commands and edit files under certain sandbox modes. It distinguishes itself from siblings by focusing on prompting Codex, while siblings like codex_read_thread and codex_local_sessions clearly handle other concerns.

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 provides clear usage patterns: pass thread_id to continue a conversation, omit it to start fresh, and use independent calls for parallel queries. While it doesn't explicitly contrast with sibling tools, it gives sufficient context on when to use this tool and how to manage conversations.

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

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