Skip to main content
Glama

Ask Codex (new session)

codex_ask

Ask OpenAI Codex a coding question or task in a new session and get the agent's final answer as text.

Instructions

Ask OpenAI Codex (codex exec) a question or task in a NEW session.

Uses your existing Codex login (ChatGPT or API key — see codex login status). Returns the agent's final message as text, read from codex's --output-last-message file (no stdout scraping). Codex is a capable coding agent, so this suits heavier reasoning and real code work, not just cheap tool-calling. Point workspace at a real project dir for context-aware answers.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelNoOptional model override (`-m`); omit to use codex's configured default.
watchNoIf true, open a live "watch" view in your browser that streams codex's steps (reasoning, the commands it runs, file changes) from its `--json` event stream. codex still runs headless; the same final text is returned. Best-effort — if the browser can't open, the run completes normally. Default false.
promptYesQuestion or instruction for Codex.
sandboxNoFilesystem policy — "read-only" (default: reads and answers but writes nothing), "workspace-write" (may edit files under the workspace), or "danger-full-access" (no sandbox — avoid). `codex exec` has no interactive approval gate, so this is the real safety boundary; opt into write access deliberately. WINDOWS CAVEAT (codex 0.149.1): sandboxed runs there currently refuse EVERY command, both policies, down to `pwd` — codex's policy engine cannot classify the `pwsh -Command <...>` wrapper it builds. Shell commands are how codex reads files, so it sees none of the workspace and ANSWERS ANYWAY, from its own knowledge or a web search, with no hint that it read nothing. The bridge appends a visible "[agent-intern] WARNING" to any answer whose run had commands refused: if you see it, treat the answer as unsourced.read-only
timeout_sNoMax seconds to wait for codex to complete. Default 180.
workspaceNoWorking root for the session (`-C`). Defaults to the server cwd.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

Beyond the annotations (readOnlyHint=false, openWorldHint=true), the description adds meaningful behavioral details: the tool uses an existing Codex login, returns only the final message read from `--output-last-message`, and does not use stdout scraping. It also hints at potentially heavy execution with 'real code work.' No contradiction with annotations; some safety specifics live in parameter descriptions, but the core behavioral traits are disclosed.

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 and front-loaded: the first sentence states the core action and session type. Every subsequent sentence earns its place—login prerequisite, output mechanism, use-case guidance, and workspace advice. No filler or repetition of schema content.

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?

For a tool that launches a coding agent, the description covers the key operational context: new session, login requirement, output retrieval method, suitability for heavy reasoning, and workspace recommendation. An output schema exists, so return-value detail is not required, and the sandbox/window caveats are handled in the parameter descriptions. An agent has enough information to invoke it correctly and set expectations.

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%, and the schema itself provides rich parameter descriptions (e.g., sandbox policies, watch behavior, timeout). The main description adds a small strategic tip about `workspace` ('Point workspace at a real project dir'), but otherwise does not need to compensate. This matches the baseline for fully documented schemas.

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 pair: 'Ask OpenAI Codex a question or task in a NEW session.' It distinguishes this from siblings by emphasizing 'NEW session,' which clearly separates it from codex_continue and other agent ask tools. The additional context that it uses `codex exec` and returns the final message makes the tool's intent unmistakable.

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 clear context for when to use it: 'suits heavier reasoning and real code work, not just cheap tool-calling.' It also advises pointing `workspace` at a real project directory for context-aware answers. However, it does not explicitly name alternatives or state when not to use it, so it falls just short of full exclusionary guidance.

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/SinanTufekci/agent-intern'

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