Skip to main content
Glama

Delegate a task to Codex

codex_delegate

Hand a self-contained coding task to a Codex subagent, get the result and changed files. Checks quota first and returns a handoff when exhausted so you can finish the work yourself.

Instructions

Hand a self-contained coding task to Codex as a subagent. Starts a fresh Codex thread, runs the task, and returns the result plus the files it changed. Checks quota first: if Codex has no quota left it returns status 'quota_exhausted' with a handoff so you can finish the work yourself instead of waiting for a reset.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskYesThe full task instruction for Codex. Be specific and self-contained.
modelNoCodex model id from codex_get_models. Omit for the account default.
scopeNoScope boundary: what Codex may and may not touch.
branchNoBranch name for the worktree. Default: "agent-router/<taskId>".
isolationNo"worktree" runs Codex in a dedicated git worktree on its own branch, so a bad turn cannot touch the user's working tree. "none" edits in place. Default: none.
waitSecondsNoHow long to block before returning a pollable taskId (default 240s, max 1800s).
reasoningEffortNoReasoning effort supported by the chosen model (see codex_get_models).
workingDirectoryYesAbsolute path Codex should treat as its working directory.
Behavior4/5

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

With no annotations provided, the description carries the full burden, and it delivers: it discloses that the tool checks quota before running, starts a fresh thread, returns changed files, and returns status 'quota_exhausted' with a handoff on failure. These are behavioral traits an agent cannot infer from the schema alone. It stops short of describing error behavior beyond quota or cost/long-running implications, but the disclosed traits are substantive.

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?

Three sentences with zero fluff: the core purpose is front-loaded first, followed by execution behavior, then the key edge case. Every sentence earns its place — the quota-exhausted sentence describes a real decision-relevant scenario for the agent rather than filler. Appropriately sized for an 8-parameter tool.

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?

For a tool with no annotations and no output schema, the description explains the essential return behavior (result plus changed files) and the most likely failure mode (quota exhaustion with handoff). The pollable taskId return is only hinted at through the waitSeconds parameter description, and the full return shape beyond 'result plus files' is underspecified. Given the moderate complexity — spawning a subagent that edits files — this is slightly better than adequate but not fully complete.

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%, so the schema already documents all 8 parameters, establishing the baseline of 3. The description adds no parameter-level meaning beyond what the schema provides — it mentions output (files changed) and quota, but neither maps to a specific parameter. This is adequate because the schema carries the parameter documentation burden.

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 states a specific verb-resource pair ('Hand a self-contained coding task to Codex as a subagent') and describes a concrete outcome: runs the task and returns the result plus changed files. 'Starts a fresh Codex thread' distinguishes this from codex_continue, and the quota-first behavior distinguishes it from codex_get_limits. An agent can tell what this tool does and roughly how it differs from nearby siblings.

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 qualifier 'self-contained coding task' implies when this tool is appropriate, and the quota_exhausted handoff describes a fallback action. However, the description never explicitly names alternatives or exclusion conditions (e.g., 'use codex_continue for ongoing conversations, codex_review for reviewing changes'), which is a real gap given nine closely related siblings. Usage context is present but only implied, not stated.

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/Marczelloo/agent-router-mcp'

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