Skip to main content
Glama

consult_codex

Submit a prompt to Codex and receive formatted output as text, JSON, or code. Specify a working directory for context.

Instructions

Consult Codex in non-interactive mode with structured output.

Processes prompt and returns formatted response.
Supports text, JSON, and code extraction formats.

Args:
    query: The prompt to send to Codex
    directory: Working directory (required)
    format: Output format - "text", "json", or "code" (default: "json")
    timeout: Optional timeout in seconds (overrides env var, recommended: 60-120)
    
Returns:
    Formatted response based on format parameter

Input Schema

NameRequiredDescriptionDefault
queryYes
formatNojson
timeoutNo
directoryYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.6/5.0
Behavior2/5

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

No annotations are provided, so the description must fully disclose behavior. It states the tool is non-interactive and supports multiple output formats, but lacks details on side effects, authentication needs, error conditions, or what happens if the directory is invalid. The return description 'Formatted response' is vague.

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 concise with a clear front-loaded purpose statement. It uses a structured Args/Returns format that is efficient. Minor redundancy exists (first sentence already says 'structured output', later repeats 'returns formatted response'), but overall no waste.

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?

The description adequately covers basic parameters and their purpose, but lacks usage context and potential edge cases. Given a 4-parameter tool with required fields and no annotations, it should explain more about output structure (especially since an output schema exists) and error handling. The timeout hint is good but incomplete.

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 input schema has 0% description coverage, so the description adds significant value by explaining each parameter: 'query' as the prompt, 'directory' as working directory (required), 'format' with options 'text', 'json', 'code' (default 'json'), and 'timeout' with hint about env var and recommended range. This clarifies meaning beyond the schema's bare type/default.

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 clearly states the tool's purpose: 'Consult Codex in non-interactive mode with structured output.' It specifies the action (consult), resource (Codex), and distinguishes from siblings (batch and stdin modes) by explicitly mentioning 'non-interactive mode'.

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 for single prompts without stdin, but does not explicitly contrast with sibling tools 'consult_codex_batch' or 'consult_codex_with_stdin'. There is no direct guidance on when to choose this tool over alternatives, leaving the agent to infer from the name and siblings.

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