Skip to main content
Glama

codex_fork_session

Destructive

Fork an existing Codex session by session ID or the latest session, but this MCP tool requires an interactive terminal and fails headlessly; use codex_request to resume a session instead.

Instructions

UNAVAILABLE from the gateway: codex fork is an interactive subcommand requiring a controlling terminal, which an MCP server cannot provide, so every call fails fast with an explanation instead of spawning a child that cannot succeed. To continue an existing Codex conversation use codex_request with a real Codex session UUID or resumeLatest: true, which run codex exec resume and work headlessly. Retained because Codex exposes no non-interactive fork today; this prompt remains argv-bound and still rejects oversized UTF-8 input as non-retryable input_too_large before the unavailability check, so the argv builder stays ready if a headless fork appears.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelNoModel name or alias (e.g. gpt-5.5, latest)
promptYesPrompt text for the forked Codex session. This codex fork path remains argv-bound and rejects oversized UTF-8 input.
forkLastNoFork from the most recent Codex session. Mutually exclusive with `sessionId`.
sessionIdNoCodex session UUID to fork from. Mutually exclusive with `forkLast`.
workspaceNoRegistered workspace alias for remote HTTP/OAuth provider calls. Do not use this field, workspace_list, or workspace_register_existing_repo as a fallback for stdio/local provider path access; pass workingDir/addDir/includeDirs directly instead.
sandboxModeNoCodex --sandbox. NEW SESSIONS ONLY: the gateway filters --sandbox out of a resume argv, so this field has no effect on a resumed request. That is NOT a guarantee that the resumed session keeps its original posture: configOverrides still passes through and can set sandbox_mode, and Codex re-resolves configuration on a cold resume. Establish the posture on the first request and verify it when it matters. On a new session, omitting it does NOT guarantee read-only: the gateway emits no --sandbox flag and Codex resolves the policy from configuration, project trust, and its own fallback, so a trusted project can resolve to workspace-write. Pass read-only explicitly for inspection. Pass workspace-write to let Codex edit files in the working dir, or danger-full-access for unrestricted access.
correlationIdNoRequest trace ID (auto if omitted)
idleTimeoutMsNoIdle timeout in ms (min 30s, max 1h, omit=CLI default)
approvalPolicyNoapprovalPolicy is unavailable for this provider. It has no effect with legacy, and mcp_managed is rejected before launch because ambient MCP configuration cannot be isolated.
askForApprovalNoDEPRECATED compatibility input: accepted but ignored because current Codex no longer accepts --ask-for-approval.
approvalStrategyNoApproval strategy: legacy is supported. mcp_managed is rejected before launch because this adapter cannot isolate ambient MCP configuration.legacy

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Addedv3.2.0
  2. Removedv3.0.0
  3. First observedv2.16.0

TDQS

A4.6/5.0
Behavior5/5

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

The description discloses the actual runtime behavior beyond annotations: every call fails fast rather than spawning a child, and oversized UTF-8 input is rejected as 'non-retryable input_too_large before the unavailability check.' Although annotations mark destructiveHint true, the description clarifies the tool cannot actually execute destructively because it is unavailable from the gateway.

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?

The description is front-loaded with the critical 'UNAVAILABLE' status and then gives routing advice and maintenance context. It is longer than minimal, but every sentence carries information about failure mode, alternative, or retained-purpose, so it earns a high score without being padded.

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 deliberately unavailable tool with an output-free failure path, the description is complete: it explains why it is unavailable, what failure looks like, the exact alternative to use, and the one input edge case that still matters. The rich 100%-covered schema supplies the remaining parameter details.

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 coverage is 100% and each parameter already has a detailed description, including the prompt's argv-bound maxLength and the mutually exclusive forkLast/sessionId. The tool description adds little parameter-level meaning beyond noting the active check order; therefore the baseline 3 applies.

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 exactly what the tool is: an unavailable stub for `codex fork` that 'every call fails fast with an explanation' because the interactive subcommand needs a controlling terminal. It also differentiates itself from the sibling by pointing to codex_request as the headless alternative, so an agent can distinguish it from other Codex tools.

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?

It explicitly tells the agent when not to use this tool and what to use instead: 'To continue an existing Codex conversation use codex_request with a real Codex session UUID or resumeLatest: true.' It also explains the tool is retained only because no non-interactive fork exists, making the intended routing unambiguous.

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

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/verivus-oss/llm-cli-gateway'

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