Skip to main content
Glama

Delegate to Codex

codex_task
Destructive

Delegate coding prompts to OpenAI Codex running locally through your ChatGPT/Codex subscription for reviews, refactors, tests, or codebase research.

Instructions

Delegate a task to OpenAI Codex, running codex exec on this computer with the user's own ChatGPT/Codex subscription. Good for a second opinion or code review, implementing a well-scoped change, refactors, writing tests, or digging through a codebase. Write a self-contained prompt: goal, relevant files, constraints, and what to report back. Codex works in cwd; with sandbox workspace-write it can edit files there. Returns Codex's final message plus a session_id that continues the same Codex session. Runs longer than wait_seconds return a job_id — poll it with codex_job.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdNoAbsolute path of the working folder (required for a new task).
modelNoCodex model slug (see codex_models). Omit to use the user's default.
imagesNoAbsolute paths of images to attach.
promptYesComplete instructions for Codex.
networkNoAllow network inside workspace-write (e.g. package installs). Default false.
sandboxNoDefault workspace-write. read-only = analyse only.
add_dirsNoExtra writable folders (new tasks only).
session_idNoContinue an earlier Codex session instead of starting fresh.
wait_secondsNoSeconds to wait before returning a job_id (0-240, default 50).
reasoning_effortNolow | medium | high | xhigh | max | ultra — support varies per model (see codex_models). Omit for the default.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.7/5.0
Behavior5/5

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

Adds substantial context beyond the destructiveHint/openWorldHint annotations: it runs locally with the user's own subscription, executes `codex exec`, works in `cwd`, can edit files there under workspace-write, and describes both return shapes (final message + session_id, or a job_id when it overruns wait_seconds). This is exactly the behavioral depth an agent needs before invoking a file-mutating local tool.

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?

Front-loads what the tool is and where it runs, then use cases, then prompt guidance, then return/job behavior. Every sentence carries information; no filler.

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 10-parameter local execution tool with no output schema, the description covers the execution model, file-edit semantics, prompt construction, session continuation, and the async job_id fallback. An agent can invoke it correctly and handle both result shapes without further context.

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?

Schema coverage is 100%, so the baseline is 3, but the description adds real meaning: it explains how to compose `prompt` (goal, relevant files, constraints, what to report back) and connects `sandbox`, `cwd`, `session_id`, and the job_id flow. This goes beyond restating the schema.

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?

States a specific action (delegate a task to OpenAI Codex via `codex exec`) and the resource/context it operates on (this computer, the user's subscription). It also implicitly distinguishes itself from the polling sibling by noting that long runs return a job_id handled by codex_job.

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?

Gives concrete use cases (second opinion, code review, well-scoped change, refactors, tests, codebase digging) and routes the agent to codex_job for waiting tasks and to codex_models for model slugs. It lacks explicit when-not-to-use guidance but the positive routing is clear.

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