Skip to main content
Glama
codex-mcp-server
by etheaven

batch-codex

Runs multiple coding tasks in sequence or parallel for mass refactoring, bulk code changes, and automated transformations, with configurable sandbox and stop-on-error controls.

Instructions

Run multiple tasks through OpenAI Codex in batch. Use when the user wants Codex to handle several tasks sequentially — mass refactoring, bulk code changes, or automated transformations.

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": {
      "tasks": "<tasks>"
    },
    "name": "batch-codex"
  }
}

Input Schema

NameRequiredDescriptionDefault
ossNoUse local Ollama server
modelNoOptional model ID, passed straight to Codex CLI (-m). Omit to use the default from ~/.codex/config.toml (recommended). Do not guess IDs: call the list-models tool to see the models this Codex install offers.
tasksYesArray of atomic tasks to delegate to Codex
searchNoEnable live web search (Codex --search). Does not change the sandbox.
sandboxNoSandbox mode: read-only, workspace-write, danger-full-accessworkspace-write
timeoutNoMaximum execution time in milliseconds. Default: CODEX_MCP_TIMEOUT_MS env var, else 600000 (10 min).
parallelNoExecute tasks in parallel (experimental)
workingDirNoWorking directory for execution
stopOnErrorNoStop execution if any task fails
enableFeaturesNoEnable feature flags
disableFeaturesNoDisable feature flags
reasoningEffortNoOptional reasoning effort (model_reasoning_effort). Common values: low, medium, high, xhigh, max; some models also take none, minimal or ultra. Support varies per model: list-models shows the levels each model accepts. Omit to use the model/config default.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed10 schema fields changedv1.4.0
    • changedInput schema / properties / model / description
      Previous value: -"Model ID. Recommended order: gpt-5.4 (default), gpt-5.3-codex (coding), gpt-5.2-codex, gpt-5.2, gpt-5.1, gpt-5, gpt-5-mini."New value: +"Optional model ID, passed straight to Codex CLI (-m). Omit to use the default from ~/.codex/config.toml (recommended). Do not guess IDs: call the list-models tool to see the models this Codex install offers."
    • addedInput schema / properties / model / minLength
      Added value: +1
    • changedInput schema / properties / reasoningEffort / description
      Previous value: -"Reasoning effort: none, minimal, low, medium, high, xhigh."New value: +"Optional reasoning effort (model_reasoning_effort). Common values: low, medium, high, xhigh, max; some models also take none, minimal or ultra. Support varies per model: list-models shows the levels each model accepts. Omit to use the model/config default."
    • removedInput schema / properties / reasoningEffort / enum
      Removed value: -[
      -  "none",
      -  "minimal",
      -  "low",
      -  "medium",
      -  "high",
      -  "xhigh"
      -]
    • addedInput schema / properties / reasoningEffort / minLength
      Added value: +1
    • addedInput schema / properties / sandbox / enum
      Added value: +[
      +  "read-only",
      +  "workspace-write",
      +  "danger-full-access"
      +]
    • changedInput schema / properties / search / description
      Previous value: -"Enable web search for all tasks (activates web_search_request feature)"New value: +"Enable live web search (Codex --search). Does not change the sandbox."
    • changedInput schema / properties / timeout / description
      Previous value: -"Maximum execution time per task in milliseconds"New value: +"Maximum execution time in milliseconds. Default: CODEX_MCP_TIMEOUT_MS env var, else 600000 (10 min)."
    • addedInput schema / properties / timeout / exclusiveMinimum
      Added value: +0
    • changedInput schema / properties / timeout / type
      Previous value: -"number"New value: +"integer"
  2. First observedv1.3.9

TDQS

A3.6/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 behavioral burden. It discloses that tasks run in batch and sequentially, which is useful beyond the schema. However, it omits important context such as mutation/side-effect risk, authentication or configuration prerequisites, failure handling, and what results are returned.

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?

The description is two sentences, front-loaded with the core action and followed by when-to-use examples. There is no redundant or wasted wording.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

This is a complex 12-parameter execution tool with no output schema and no annotations. The description covers purpose and basic usage but does not explain return values, failure behavior, or safety implications, leaving significant gaps for invocation.

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 12 parameters thoroughly. The description does not add any parameter-specific meaning, which is acceptable given the rich schema but does not exceed the baseline.

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 description clearly states a specific verb and resource: running multiple tasks through OpenAI Codex in batch. It gives concrete examples like mass refactoring and bulk code changes. It does not explicitly contrast with the single-task sibling ask-codex, so it stops short of full sibling differentiation.

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

Usage Guidelines4/5

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

It provides a clear usage trigger: when the user wants Codex to handle several tasks sequentially, such as mass refactoring or bulk code changes. It does not state when not to use the tool or explicitly name an alternative like ask-codex, so it lacks exclusion guidance.

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