Skip to main content
Glama

Start Codex Session

codex
Destructive

Starts asynchronous coding-agent sessions for long-running tasks and returns poll intervals, so clients can monitor progress while controlling approvals and sandbox access.

Instructions

Start session asynchronously and return { sessionId, threadId, status, pollInterval }. Use pollInterval as a minimum hint: running >=120000ms (increase for long tasks), waiting_approval ~=1000ms.

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": {
      "prompt": "<prompt>",
      "approvalPolicy": "<approvalPolicy>",
      "sandbox": "<sandbox>"
    },
    "name": "codex"
  }
}

Input Schema

NameRequiredDescriptionDefault
cwdNoWorking directory (default: server cwd).
modelNoModel override (default: config.toml)
effortNoReasoning effort (default: low).low
promptYesTask or question
profileNoProfile name (default: CLI default profile).
sandboxYesRequired enum: read-only/workspace-write/danger-full-access.
advancedNoAdvanced settings.
approvalPolicyYesRequired enum: untrusted/on-failure/on-request/never.

Output Schema

NameRequiredDescriptionDefault
errorNo
statusNo
isErrorNo
threadIdNo
sessionIdNo
pollIntervalNoRecommended minimum delay before next poll (ms): running >=120000, waiting_approval ~=1000.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.1.0

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true, openWorldHint=true, and idempotentHint=false, so the safety profile is covered. The description usefully adds that the start is asynchronous and how aggressively to poll, but says nothing about what the session can do to the filesystem, how approvals arrive, or the auto-decline timeout that ends stalled sessions.

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?

Two compact sentences with the return shape front-loaded and polling cadence stated as actionable numbers. The field list mildly duplicates the existing output schema, but nothing is padded.

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?

With 8 parameters including nested advanced settings and an output schema present, return-value explanation is not required, and the description correctly focuses on the async/polling contract. For a destructive, open-world session launcher, though, it omits the lifecycle story — how to check status, reply to approvals, or what approvalPolicy/sandbox imply.

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% and every input (cwd, model, effort, sandbox, approvalPolicy, advanced.*) is documented inline, so the baseline of 3 applies. The description adds no meaning to any input parameter — its polling notes concern an output field, not the schema.

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?

States a specific verb and resource ('Start session asynchronously') and names the return payload, so the agent knows this launches a Codex run rather than querying one. It does not explicitly name the sibling it differs from (codex_check/codex_reply), leaving differentiation implicit.

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 pollInterval guidance gives concrete follow-up behavior for `running` and `waiting_approval` states, which is real usage context. But it never says when to choose this tool over codex_session, nor mentions that the required approvalPolicy/sandbox choices gate how the session behaves.

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