Skip to main content
Glama

delegate

Destructive

Send coding tasks to OpenAI Codex, set workspace and mode, then check run status before using results so agents can plan and review while Codex executes.

Instructions

Delegate a coding task to OpenAI Codex. Never run codex from the shell — use this tool. Check status before trusting result — a run that spawns then fails returns normally. Set spec, workspace and mode, plus resumeThreadId to resume and reviewTarget in review; leave every other field at its default unless the user asks. See the delegate skill.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "spec": "<spec>",
      "workspace": "<workspace>"
    },
    "name": "delegate"
  }
}

Input Schema

NameRequiredDescriptionDefault
fastNoCodex Fast mode; higher credit use.
modeNoagent implements; plan returns a structured plan; ask answers; review runs native review.agent
specYesBrief with goal, scope, fixed decisions quoted exactly, and acceptance criteria; reference files instead of pasting code.
modelNoCodex model id. doctor deep:true lists every id.gpt-6-luna
timeoutMsNoWhole-run cap in ms (default 6h). Mid-turn silence is allowed; startup has a separate 60s first-output deadline.
webSearchNoCodex's built-in web search.
workspaceYesCodex's working directory; not confinement. Must already exist — never create one for the call.
reviewTargetNoRequired in review; forbidden otherwise: uncommitted, base branch, or commit.
resumeThreadIdNoThread to continue. Reuse its workspace. Forbidden with review.
reasoningEffortNoCodex reasoning level. doctor deep:true lists each model's levels.xhigh

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.8.0
    • changedInput schema / properties / timeoutMs / description
      Previous value: -"Whole-run cap in ms (default 1h). Mid-turn silence is allowed; startup has a separate 60s first-output deadline."New value: +"Whole-run cap in ms (default 6h). Mid-turn silence is allowed; startup has a separate 60s first-output deadline."
  2. Changed6 schema fields changedv2.5.0
    • changedInput schema / properties / model / default
      Previous value: -"gpt-5.6-luna"New value: +"gpt-6-luna"
    • changedInput schema / properties / model / description
      Previous value: -"Codex model id: gpt-5.6-luna, gpt-6-luna, gpt-6-sol, gpt-6-astra, gpt-5.6-sol, gpt-5.6-terra, gpt-5.5."New value: +"Codex model id. doctor deep:true lists every id."
    • changedInput schema / properties / reasoningEffort / description
      Previous value: -"minimal is rejected by every published model; none is rejected by gpt-6-astra and accepted elsewhere, though the catalog omits it."New value: +"Codex reasoning level. doctor deep:true lists each model's levels."
    • removedInput schema / properties / reasoningEffort / enum
      Removed value: -[
      -  "none",
      -  "minimal",
      -  "low",
      -  "medium",
      -  "high",
      -  "xhigh",
      -  "max",
      -  "ultra"
      -]
    • removedInput schema / properties / reviewTarget / anyOf
      Removed value: -[
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "kind": {
      -        "const": "uncommitted",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "kind"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "branch": {
      -        "type": "string"
      -      },
      -      "kind": {
      -        "const": "base",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "kind",
      -      "branch"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "kind": {
      -        "const": "commit",
      -        "type": "string"
      -      },
      -      "sha": {
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "kind",
      -      "sha"
      -    ],
      -    "type": "object"
      -  }
      -]
    • addedInput schema / properties / reviewTarget / oneOf
      Added value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "kind": {
      +        "const": "uncommitted",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "kind"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "branch": {
      +        "type": "string"
      +      },
      +      "kind": {
      +        "const": "base",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "kind",
      +      "branch"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "kind": {
      +        "const": "commit",
      +        "type": "string"
      +      },
      +      "sha": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "kind",
      +      "sha"
      +    ],
      +    "type": "object"
      +  }
      +]
  3. Changed2 schema fields changedv2.3.0
    • changedInput schema / properties / model / description
      Previous value: -"Codex model id: gpt-5.6-luna, gpt-5.6-sol, gpt-5.6-terra, gpt-5.5, gpt-5.4, gpt-5.4-mini."New value: +"Codex model id: gpt-5.6-luna, gpt-6-luna, gpt-6-sol, gpt-6-astra, gpt-5.6-sol, gpt-5.6-terra, gpt-5.5."
    • changedInput schema / properties / reasoningEffort / description
      Previous value: -"minimal is rejected by every published model; none is accepted though the catalog omits it."New value: +"minimal is rejected by every published model; none is rejected by gpt-6-astra and accepted elsewhere, though the catalog omits it."
  4. Changed1 schema field changedv2.2.1
    • changedInput schema / properties / reasoningEffort / description
      Previous value: -"gpt-5.6-* reject minimal; older models reject none."New value: +"minimal is rejected by every published model; none is accepted though the catalog omits it."
  5. Changed6 schema fields changedv2.0.0
    • changedInput schema / properties / model / default
      Previous value: -"gpt-5.6-terra"New value: +"gpt-5.6-luna"
    • changedInput schema / properties / model / description
      Previous value: -"Codex model id: gpt-5.6-terra, gpt-5.6-sol, gpt-5.6-luna, gpt-5.5, gpt-5.4, gpt-5.4-mini and more."New value: +"Codex model id: gpt-5.6-luna, gpt-5.6-sol, gpt-5.6-terra, gpt-5.5, gpt-5.4, gpt-5.4-mini."
    • changedInput schema / properties / reasoningEffort / default
      Previous value: -"high"New value: +"xhigh"
    • changedInput schema / properties / reasoningEffort / enum
      Previous value: -[
      -  "none",
      -  "minimal",
      -  "low",
      -  "medium",
      -  "high",
      -  "xhigh",
      -  "max"
      -]New value: +[
      +  "none",
      +  "minimal",
      +  "low",
      +  "medium",
      +  "high",
      +  "xhigh",
      +  "max",
      +  "ultra"
      +]
    • changedInput schema / properties / workspace / description
      Previous value: -"Codex's working directory; not confinement. Must already exist — never create one for the call. Defaults to the server cwd, often not the project root under npx/plugin. Required on resume: resume has no --cd."New value: +"Codex's working directory; not confinement. Must already exist — never create one for the call."
    • changedInput schema / required
      Previous value: -[
      -  "spec"
      -]New value: +[
      +  "spec",
      +  "workspace"
      +]
  6. Changed11 schema fields changedv1.21.1
    • changedInput schema / properties / fast / description
      Previous value: -"Codex Fast mode (service_tier=fast) — higher credit use"New value: +"Codex Fast mode; higher credit use."
    • addedInput schema / properties / mode / description
      Added value: +"agent implements; plan returns a structured plan; ask answers; review runs native review."
    • changedInput schema / properties / model / description
      Previous value: -"Codex model id"New value: +"Codex model id: gpt-5.6-terra, gpt-5.6-sol, gpt-5.6-luna, gpt-5.5, gpt-5.4, gpt-5.4-mini and more."
    • removedInput schema / properties / network
      Removed value: -{
      -  "default": true,
      -  "description": "Web search, and network from Codex's shell in agent mode. false seals the run",
      -  "type": "boolean"
      -}
    • changedInput schema / properties / reasoningEffort / description
      Previous value: -"Reasoning effort. gpt-5.6-* reject minimal; older models reject none"New value: +"gpt-5.6-* reject minimal; older models reject none."
    • changedInput schema / properties / resumeThreadId / description
      Previous value: -"Resume an existing Codex thread instead of starting a new one"New value: +"Thread to continue. Reuse its workspace. Forbidden with review."
    • changedInput schema / properties / reviewTarget / description
      Previous value: -"Required in review mode: uncommitted, base branch, or commit sha"New value: +"Required in review; forbidden otherwise: uncommitted, base branch, or commit."
    • changedInput schema / properties / spec / description
      Previous value: -"Task brief: goal, scope, decisions already made (quote the user's exact values), acceptance criteria. Point at files to read rather than pasting code."New value: +"Brief with goal, scope, fixed decisions quoted exactly, and acceptance criteria; reference files instead of pasting code."
    • changedInput schema / properties / timeoutMs / description
      Previous value: -"Hard-cap timeout in milliseconds (default 1h). A long silent command is not a timeout; only the 60s spawn-to-first-output deadline is."New value: +"Whole-run cap in ms (default 1h). Mid-turn silence is allowed; startup has a separate 60s first-output deadline."
    • addedInput schema / properties / webSearch
      Added value: +{
      +  "default": true,
      +  "description": "Codex's built-in web search.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / workspace / description
      Previous value: -"Working directory for Codex. Optional; defaults to the server process cwd, which for npx and plugin launches is not necessarily your project root — pass it explicitly. Smallest directory holding the task's files; none → project root. Must already exist — never create one for the call. Required when resuming: codex exec resume has no --cd."New value: +"Codex's working directory; not confinement. Must already exist — never create one for the call. Defaults to the server cwd, often not the project root under npx/plugin. Required on resume: resume has no --cd."
  7. Changed3 schema fields changedv1.18.1
    • changedInput schema / properties / reasoningEffort / enum
      Previous value: -[
      -  "none",
      -  "minimal",
      -  "low",
      -  "medium",
      -  "high",
      -  "xhigh"
      -]New value: +[
      +  "none",
      +  "minimal",
      +  "low",
      +  "medium",
      +  "high",
      +  "xhigh",
      +  "max"
      +]
    • changedInput schema / properties / workspace / description
      Previous value: -"Working directory for Codex (defaults to cwd)"New value: +"Working directory for Codex. Optional; defaults to the server process cwd, which for npx and plugin launches is not necessarily your project root — pass it explicitly. Smallest directory holding the task's files; none → project root. Must already exist — never create one for the call. Required when resuming: codex exec resume has no --cd."
    • changedOutput schema / (root)
      Previous value: -{
      -  "$schema": "http://json-schema.org/draft-07/schema#",
      -  "additionalProperties": true,
      -  "properties": {
      -    "cliVersion": {
      -      "type": "string"
      -    },
      -    "delegationId": {
      -      "type": "string"
      -    },
      -    "exitCode": {
      -      "type": "integer"
      -    },
      -    "filesReportedByEditTools": {
      -      "items": {
      -        "type": "string"
      -      },
      -      "type": "array"
      -    },
      -    "plan": {
      -      "additionalProperties": false,
      -      "properties": {
      -        "overview": {
      -          "type": "string"
      -        },
      -        "steps": {
      -          "items": {
      -            "additionalProperties": false,
      -            "properties": {
      -              "detail": {
      -                "type": "string"
      -              },
      -              "title": {
      -                "type": "string"
      -              }
      -            },
      -            "required": [
      -              "title",
      -              "detail"
      -            ],
      -            "type": "object"
      -          },
      -          "type": "array"
      -        }
      -      },
      -      "required": [
      -        "overview",
      -        "steps"
      -      ],
      -      "type": "object"
      -    },
      -    "reason": {
      -      "enum": [
      -        "cancelled",
      -        "startup-timeout",
      -        "hard-cap",
      -        "agent-error",
      -        "died-mid-turn",
      -        "exit-nonzero"
      -      ],
      -      "type": "string"
      -    },
      -    "result": {
      -      "type": "string"
      -    },
      -    "resultSource": {
      -      "const": "stream-fallback",
      -      "type": "string"
      -    },
      -    "resumed": {
      -      "type": "boolean"
      -    },
      -    "status": {
      -      "enum": [
      -        "completed",
      -        "failed",
      -        "interrupted"
      -      ],
      -      "type": "string"
      -    },
      -    "threadId": {
      -      "type": "string"
      -    },
      -    "usage": {
      -      "additionalProperties": false,
      -      "properties": {
      -        "cacheWriteInputTokens": {
      -          "type": "number"
      -        },
      -        "cachedInputTokens": {
      -          "type": "number"
      -        },
      -        "inputTokens": {
      -          "type": "number"
      -        },
      -        "outputTokens": {
      -          "type": "number"
      -        },
      -        "reasoningOutputTokens": {
      -          "type": "number"
      -        }
      -      },
      -      "type": "object"
      -    },
      -    "warnings": {
      -      "items": {
      -        "type": "string"
      -      },
      -      "type": "array"
      -    },
      -    "workspace": {
      -      "type": "string"
      -    }
      -  },
      -  "required": [
      -    "result",
      -    "status",
      -    "workspace"
      -  ],
      -  "type": "object"
      -}New value: +null
  8. Changed1 schema field changedv1.14.1
    • addedOutput schema / properties / delegationId
      Added value: +{
      +  "type": "string"
      +}
  9. First observedv1.11.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare destructive and open-world behavior, but the description adds a genuinely non-obvious failure mode: a run can spawn and then fail while still returning normally, so the caller must verify status before trusting output. It does not cover credit consumption or how the status check is performed, which holds it below a 5.

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?

Four dense sentences, front-loaded with the verb and the hard constraint, then the failure warning, then parameter policy. Nothing is decorative and the trailing skill pointer is short.

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 destructive, open-world, ten-parameter tool with no output schema, the definition covers purpose, constraint, failure semantics and parameter policy well. It is thinner on what actually comes back (thread id, run output) and how status is checked, which is the one notable gap given the absent output schema.

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?

With 100% schema coverage the baseline is 3, and the description rises above it by triaging the ten parameters: set spec, workspace and mode, add resumeThreadId to resume, add reviewTarget only in review, and leave the rest defaulted unless the user asks. That is real selection guidance the schema alone does not provide.

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 verb and resource ("Delegate a coding task to OpenAI Codex") and immediately scopes it against the obvious wrong path ("Never run codex from the shell — use this tool"). Siblings cancel and doctor are self-evidently distinct, so no ambiguity remains.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit when-to-use (delegate rather than shell out), a mandatory pre-trust step ("Check status before trusting result"), and per-mode routing for mode, resumeThreadId and reviewTarget, plus a default rule for remaining fields. That is concrete operational guidance rather than implied usage.

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

Deploy Server

Other Tools