Skip to main content
Glama

codex_exec

Launch a Codex (ChatGPT Plus) sub-agent session to execute structured coding or analysis tasks, with optional model-tier routing, local image attachments, and isolated Git worktree writes.

Instructions

以子 Agent 形式启动新的 Codex (ChatGPT Plus) 会话执行任务。支持模型分级路由(tier)、本地图片附件(images)和独立 Git worktree 隔离写入(worktree)。若 tier 模型不被账号支持会自动回退 CLI 默认模型。

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": {
      "account": "<account>",
      "prompt": "<prompt>"
    },
    "name": "codex_exec"
  }
}

Input Schema

NameRequiredDescriptionDefault
tierNo可选:模型分级路由(economy=gpt-6-luna 轻量初筛;balanced=gpt-6.2-sol 日常代码/审查;flagship=gpt-6.2-astra 科研推导/疑难Debug;vision=gpt-6.1-terra 视觉核验)。
modelNo可选:显式指定模型名(优先级高于 tier)。
topicNo推荐:主 Agent 自动总结的简短主题名(如「数学建模核验」「代码评审」)。
imagesNo可选:本地图片绝对路径数组(论文图表、公式或报错截图),底层透传 -i。
promptYes必填:发送给 GPT 子 Agent 的结构化任务单。
accountYes必填:已选定的 Plus 账号 ID 或自定义备注名(如 plus-1 或 personal)。
sandboxNo默认 read-only(单写原则);worktree=true 时自动启用 workspace-write。
worktreeNo可选:是否在独立 Git worktree 中隔离写入(默认 false;开启前自动校验 Git 仓库)。
working_dirNo可选:工作目录绝对路径(worktree=true 时必填有效 Git 仓库)。
timeout_secondsNo可选:超时秒数(默认 300,最大 900)。
reasoning_effortNo可选:推理深度分层(常规 high;核心科研证明、数学建模关键推导、复杂算法、资金/数据/权限安全用 xhigh)。

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.3.0

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It does disclose two useful behaviors beyond the schema: automatic fallback to the CLI default model when the tier is unsupported, and that worktree writes are isolated with Git-repo validation. However it says nothing about run duration/blocking nature, the account auth requirement, or what the sub-agent returns.

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?

Three short sentences: purpose first, capability summary second, edge-case behavior third. No filler, and the most important information is front-loaded. Slightly list-like but appropriate for a tool with 11 parameters.

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?

This is a complex, long-running sub-agent invocation with 11 parameters and no output schema, yet the description never explains what is returned (final message, logs, artifact paths) or that account must be pre-selected via codex_list_accounts. Combined with the absent usage routing guidance, it is adequate but incomplete for the tool's complexity.

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 every parameter (tier enum meanings, model precedence, sandbox default, worktree, timeout, reasoning_effort) is already documented in structured data. The description only restates the three headline parameters and adds the tier-fallback rule, so it adds little semantic meaning beyond the schema; baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The first sentence gives a concrete verb+resource: launch a new Codex (ChatGPT Plus) session as a sub-agent to execute a task. The word '新的' (new) implicitly separates it from codex_resume, but no sibling is named explicitly, so an agent must infer the boundary with review/resume tools.

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?

Usage is only implied: 'new session' hints at when to prefer this over resuming, and the tier fallback note tells the agent it can route optimistically. There is no explicit when-to-use or when-not-to-use statement and no named alternative, so guidance is minimal.

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