Skip to main content
Glama

Review workspace changes with Codex

codex_review

Review uncommitted workspace changes with Codex in a read-only sandbox that modifies no files. Returns severity-ordered findings and a sessionId for follow-up.

Instructions

Ask Codex to review the uncommitted changes in a workspace (read-only sandbox, no files modified). Returns findings ordered by severity plus a sessionId usable with codex_continue.

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": {
      "cwd": "<cwd>"
    },
    "name": "codex_review"
  }
}

Input Schema

NameRequiredDescriptionDefault
cwdYesAbsolute path of the workspace to review
focusNoOptional focus for the review, e.g. "security of the auth module"
modelNoCodex model override
scopeNoDeclared task scope. Findings gain `inScope` and reviewFindings gains `outOfScopeCount`; nothing is dropped, so an out-of-scope defect is still reported.
terminalNoOpen a Terminal window streaming live progress (default: env CODEX_MCP_TERMINAL=1)
timeoutMsNoMax execution time per attempt in ms; auto-resume may add attempts (default: 60 minutes)
writeNotesNoPersist a markdown summary of this run to <cwd>/.codex-flow/notes/<sessionId>.md (default false).
baselineRefNoOptional git ref to review from: Codex reviews `git diff <baselineRef>..HEAD` plus current uncommitted changes, so checkpoint/merge commits made since the baseline are covered.
reasoningEffortNoReasoning effort override for the selected model

Output Schema

NameRequiredDescriptionDefault
diffYes
runIdYes
usageYes
errorsYes
statusYes
stderrYes
abortedYes
liveLogYes
acceptedYes
attemptsNo
commandsYes
exitCodeYes
timedOutYes
warningsYes
notesPathYes
sessionIdYes
turnCountYes
redactionsNo
attributionYes
fileChangesYes
parseErrorsYes
agentMessageYes
verificationNo
resumeReasonsNo
sawCompletionYes
schemaVersionYes
unknownEventsYes
reviewFindingsNo
outputTruncatedYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.38.0
    • changedOutput schema / properties / attribution / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "files": {
      -        "items": {
      -          "additionalProperties": {},
      -          "properties": {},
      -          "type": "object"
      -        },
      -        "type": "array"
      -      },
      -      "untracked": {
      -        "items": {
      -          "additionalProperties": {},
      -          "properties": {},
      -          "type": "object"
      -        },
      -        "type": "array"
      -      }
      -    },
      -    "required": [
      -      "files",
      -      "untracked"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "files": {
      +        "items": {
      +          "additionalProperties": {},
      +          "properties": {},
      +          "type": "object"
      +        },
      +        "type": "array"
      +      },
      +      "reason": {
      +        "type": "string"
      +      },
      +      "unavailable": {
      +        "type": "boolean"
      +      },
      +      "untracked": {
      +        "items": {
      +          "additionalProperties": {},
      +          "properties": {},
      +          "type": "object"
      +        },
      +        "type": "array"
      +      }
      +    },
      +    "required": [
      +      "files",
      +      "untracked"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedOutput schema / properties / diff / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "patch": {
      -        "type": "string"
      -      },
      -      "status": {
      -        "type": "string"
      -      },
      -      "statusTruncated": {
      -        "type": "boolean"
      -      },
      -      "truncated": {
      -        "type": "boolean"
      -      }
      -    },
      -    "required": [
      -      "status",
      -      "statusTruncated",
      -      "patch",
      -      "truncated"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "patch": {
      +        "type": "string"
      +      },
      +      "reason": {
      +        "type": "string"
      +      },
      +      "status": {
      +        "type": "string"
      +      },
      +      "statusTruncated": {
      +        "type": "boolean"
      +      },
      +      "truncated": {
      +        "type": "boolean"
      +      },
      +      "unavailable": {
      +        "type": "boolean"
      +      }
      +    },
      +    "required": [
      +      "status",
      +      "statusTruncated",
      +      "patch",
      +      "truncated"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
  2. Changed18 schema fields changedv0.25.0
    • addedInput schema / properties / scope
      Added value: +{
      +  "description": "Declared task scope. Findings gain `inScope` and reviewFindings gains `outOfScopeCount`; nothing is dropped, so an out-of-scope defect is still reported.",
      +  "properties": {
      +    "contract": {
      +      "description": "The task contract the reviewer should check conformance against (max 4000 chars).",
      +      "maxLength": 4000,
      +      "type": "string"
      +    },
      +    "files": {
      +      "description": "Paths the task is allowed to touch, relative to cwd (1-200 entries).",
      +      "items": {
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "maxItems": 200,
      +      "minItems": 1,
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "files"
      +  ],
      +  "type": "object"
      +}
    • addedOutput schema / properties / accepted
      Added value: +{
      +  "type": "boolean"
      +}
    • removedOutput schema / properties / agentMessage / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / agentMessage / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • removedOutput schema / properties / commands / items / properties / exitCode / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / commands / items / properties / exitCode / type
      Added value: +[
      +  "number",
      +  "null"
      +]
    • removedOutput schema / properties / exitCode / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / exitCode / type
      Added value: +[
      +  "number",
      +  "null"
      +]
    • removedOutput schema / properties / liveLog / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / liveLog / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • removedOutput schema / properties / notesPath / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / notesPath / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • addedOutput schema / properties / redactions
      Added value: +{
      +  "type": "number"
      +}
    • addedOutput schema / properties / reviewFindings
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "dropped": {
      +      "type": "number"
      +    },
      +    "droppedReasons": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "findings": {
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "expected": {
      +            "minLength": 1,
      +            "type": "string"
      +          },
      +          "file": {
      +            "minLength": 1,
      +            "type": "string"
      +          },
      +          "inScope": {
      +            "type": "boolean"
      +          },
      +          "line": {
      +            "maximum": 9007199254740991,
      +            "minimum": -9007199254740991,
      +            "type": "integer"
      +          },
      +          "observed": {
      +            "minLength": 1,
      +            "type": "string"
      +          },
      +          "severity": {
      +            "enum": [
      +              "CRITICAL",
      +              "HIGH",
      +              "MEDIUM",
      +              "LOW"
      +            ],
      +            "type": "string"
      +          },
      +          "summary": {
      +            "minLength": 1,
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "severity",
      +          "file",
      +          "line",
      +          "summary",
      +          "expected",
      +          "observed"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "improvements": {
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "file": {
      +            "type": "string"
      +          },
      +          "id": {
      +            "minLength": 1,
      +            "type": "string"
      +          },
      +          "summary": {
      +            "minLength": 1,
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "id",
      +          "summary"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "outOfScopeCount": {
      +      "maximum": 9007199254740991,
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    "parseError": {
      +      "type": "string"
      +    },
      +    "parsed": {
      +      "type": "boolean"
      +    }
      +  },
      +  "required": [
      +    "parsed",
      +    "findings",
      +    "improvements",
      +    "dropped",
      +    "droppedReasons"
      +  ],
      +  "type": "object"
      +}
    • removedOutput schema / properties / sessionId / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / sessionId / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • addedOutput schema / properties / verification
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": false,
      +      "properties": {
      +        "command": {
      +          "type": "string"
      +        },
      +        "durationMs": {
      +          "type": "number"
      +        },
      +        "exitCode": {
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        },
      +        "outputTail": {
      +          "type": "string"
      +        },
      +        "passed": {
      +          "type": "boolean"
      +        },
      +        "redactions": {
      +          "type": "number"
      +        },
      +        "skipped": {
      +          "enum": [
      +            "aborted",
      +            "run-failed"
      +          ],
      +          "type": "string"
      +        },
      +        "timedOut": {
      +          "type": "boolean"
      +        }
      +      },
      +      "required": [
      +        "command",
      +        "exitCode",
      +        "timedOut",
      +        "durationMs",
      +        "outputTail",
      +        "passed"
      +      ],
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ]
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "sessionId",
      -  "agentMessage",
      -  "fileChanges",
      -  "commands",
      -  "usage",
      -  "errors",
      -  "parseErrors",
      -  "unknownEvents",
      -  "sawCompletion",
      -  "warnings",
      -  "turnCount",
      -  "schemaVersion",
      -  "status",
      -  "runId",
      -  "diff",
      -  "attribution",
      -  "exitCode",
      -  "timedOut",
      -  "aborted",
      -  "outputTruncated",
      -  "stderr",
      -  "liveLog",
      -  "notesPath"
      -]New value: +[
      +  "sessionId",
      +  "agentMessage",
      +  "fileChanges",
      +  "commands",
      +  "usage",
      +  "errors",
      +  "parseErrors",
      +  "unknownEvents",
      +  "sawCompletion",
      +  "warnings",
      +  "turnCount",
      +  "schemaVersion",
      +  "status",
      +  "accepted",
      +  "runId",
      +  "diff",
      +  "attribution",
      +  "exitCode",
      +  "timedOut",
      +  "aborted",
      +  "outputTruncated",
      +  "stderr",
      +  "liveLog",
      +  "notesPath"
      +]
  3. Changed4 schema fields changedv0.13.0
    • addedInput schema / properties / baselineRef
      Added value: +{
      +  "description": "Optional git ref to review from: Codex reviews `git diff <baselineRef>..HEAD` plus current uncommitted changes, so checkpoint/merge commits made since the baseline are covered.",
      +  "maxLength": 256,
      +  "minLength": 1,
      +  "pattern": "^[A-Za-z0-9_][A-Za-z0-9_./@{}^~-]*$",
      +  "type": "string"
      +}
    • addedInput schema / properties / reasoningEffort
      Added value: +{
      +  "description": "Reasoning effort override for the selected model",
      +  "enum": [
      +    "minimal",
      +    "low",
      +    "medium",
      +    "high",
      +    "xhigh"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / timeoutMs / description
      Previous value: -"Max execution time in ms (default: 30 minutes)"New value: +"Max execution time per attempt in ms; auto-resume may add attempts (default: 60 minutes)"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "aborted": {
      +      "type": "boolean"
      +    },
      +    "agentMessage": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "attempts": {
      +      "type": "number"
      +    },
      +    "attribution": {
      +      "anyOf": [
      +        {
      +          "additionalProperties": false,
      +          "properties": {
      +            "files": {
      +              "items": {
      +                "additionalProperties": {},
      +                "properties": {},
      +                "type": "object"
      +              },
      +              "type": "array"
      +            },
      +            "untracked": {
      +              "items": {
      +                "additionalProperties": {},
      +                "properties": {},
      +                "type": "object"
      +              },
      +              "type": "array"
      +            }
      +          },
      +          "required": [
      +            "files",
      +            "untracked"
      +          ],
      +          "type": "object"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "commands": {
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "command": {
      +            "type": "string"
      +          },
      +          "exitCode": {
      +            "anyOf": [
      +              {
      +                "type": "number"
      +              },
      +              {
      +                "type": "null"
      +              }
      +            ]
      +          }
      +        },
      +        "required": [
      +          "command",
      +          "exitCode"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "diff": {
      +      "anyOf": [
      +        {
      +          "additionalProperties": false,
      +          "properties": {
      +            "patch": {
      +              "type": "string"
      +            },
      +            "status": {
      +              "type": "string"
      +            },
      +            "statusTruncated": {
      +              "type": "boolean"
      +            },
      +            "truncated": {
      +              "type": "boolean"
      +            }
      +          },
      +          "required": [
      +            "status",
      +            "statusTruncated",
      +            "patch",
      +            "truncated"
      +          ],
      +          "type": "object"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "errors": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "exitCode": {
      +      "anyOf": [
      +        {
      +          "type": "number"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "fileChanges": {
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "kind": {
      +            "type": "string"
      +          },
      +          "path": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "path",
      +          "kind"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "liveLog": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "notesPath": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "outputTruncated": {
      +      "type": "boolean"
      +    },
      +    "parseErrors": {
      +      "type": "number"
      +    },
      +    "resumeReasons": {
      +      "items": {
      +        "enum": [
      +          "timeout",
      +          "transient-turn-failure",
      +          "no-completion-marker"
      +        ],
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "runId": {
      +      "type": "string"
      +    },
      +    "sawCompletion": {
      +      "type": "boolean"
      +    },
      +    "schemaVersion": {
      +      "type": "number"
      +    },
      +    "sessionId": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "status": {
      +      "enum": [
      +        "success",
      +        "partial",
      +        "failed",
      +        "aborted"
      +      ],
      +      "type": "string"
      +    },
      +    "stderr": {
      +      "type": "string"
      +    },
      +    "timedOut": {
      +      "type": "boolean"
      +    },
      +    "turnCount": {
      +      "type": "number"
      +    },
      +    "unknownEvents": {
      +      "type": "number"
      +    },
      +    "usage": {
      +      "anyOf": [
      +        {
      +          "additionalProperties": false,
      +          "properties": {
      +            "cachedInputTokens": {
      +              "type": "number"
      +            },
      +            "inputTokens": {
      +              "type": "number"
      +            },
      +            "outputTokens": {
      +              "type": "number"
      +            },
      +            "reasoningOutputTokens": {
      +              "type": "number"
      +            }
      +          },
      +          "required": [
      +            "inputTokens",
      +            "cachedInputTokens",
      +            "outputTokens",
      +            "reasoningOutputTokens"
      +          ],
      +          "type": "object"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "warnings": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "sessionId",
      +    "agentMessage",
      +    "fileChanges",
      +    "commands",
      +    "usage",
      +    "errors",
      +    "parseErrors",
      +    "unknownEvents",
      +    "sawCompletion",
      +    "warnings",
      +    "turnCount",
      +    "schemaVersion",
      +    "status",
      +    "runId",
      +    "diff",
      +    "attribution",
      +    "exitCode",
      +    "timedOut",
      +    "aborted",
      +    "outputTruncated",
      +    "stderr",
      +    "liveLog",
      +    "notesPath"
      +  ],
      +  "type": "object"
      +}
  4. Changed1 schema field changedv0.8.0
    • addedInput schema / properties / writeNotes
      Added value: +{
      +  "description": "Persist a markdown summary of this run to <cwd>/.codex-flow/notes/<sessionId>.md (default false).",
      +  "type": "boolean"
      +}
  5. First observedv0.2.0

TDQS

A4.2/5.0
Behavior4/5

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

No annotations are supplied, so the description carries the burden and does well: it discloses the read-only sandbox, that no files are modified, and the shape of the result (severity-ordered findings plus a sessionId). It does not mention side effects exposed in the schema such as writeNotes persistence, terminal streaming, or auto-resume attempts.

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?

Two tight sentences with no filler; the sandbox safety constraint is front-loaded and the return shape plus continuation path follow immediately. Every clause carries distinct information.

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?

With an output schema present, the description needn't enumerate return fields, and it still gives the essential result shape and the sessionId handoff. For a nine-parameter tool with nested scope, it covers the core intent adequately, though it leaves the writeNotes and terminal side effects to the schema.

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 one of the nine parameters is already documented in structured fields including scope semantics, timeouts, and baselineRef. The description adds no parameter-level meaning beyond what the schema provides, making the baseline 3 correct.

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 ('review the uncommitted changes in a workspace') and immediately scopes it, so an agent can tell this apart from codex_execute or codex_batch. It also names codex_continue as the follow-up path, anchoring the tool in the sibling set.

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?

The condition for use is clear: reviewing uncommitted workspace changes, with codex_continue indicated for follow-up on the returned sessionId. There is no explicit exclusion of alternatives (e.g. when to prefer codex_execute), which keeps it from a 5.

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