Skip to main content
Glama

Restore a checkpoint

codex_restore

Restore your working tree to a previous checkpoint when Codex changes break your code. The current state is saved as a new checkpoint first, making the rollback reversible.

Instructions

Roll the working tree back to a checkpoint — use it when Codex made things worse. This overwrites files on disk, so confirm with the user before calling it unless they already asked for the rollback. The pre-restore state is always captured as a new checkpoint first, so the operation is itself undoable.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskIdYesTask the checkpoint belongs to.
checkpointIdYesCheckpoint id from codex_checkpoints, e.g. "cp-1".
removeUntrackedNoAlso delete files created after the checkpoint. Default false — they are reported as leftovers instead.
Behavior5/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states that files on disk are overwritten (destructive), requires user confirmation, and reveals that the pre-restore state is captured as a new checkpoint, making the operation undoable. This is thorough and directly useful for safe invocation.

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?

Three sentences with zero waste: purpose/trigger first, then the destructive warning and consent requirement, then the undo guarantee. Every sentence earns its place and the most critical safety information is front-loaded.

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 destructive mutation tool with no annotations and no output schema, the description covers the essential context: what it does, when to use it, side effects, user-consent requirements, and undoability. Schema handles parameter details. Nothing critical is missing for correct 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%, and the schema already explains taskId, checkpointId, and removeUntracked. The description reinforces the checkpoint concept but adds no parameter-specific syntax or format detail beyond the schema. Baseline 3 is appropriate when the schema does the heavy lifting.

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 a specific action ('roll the working tree back to a checkpoint') and a clear trigger ('use it when Codex made things worse'). This distinguishes it from siblings like codex_checkpoints, which lists checkpoints, and codex_review, which reviews work. The verb and resource are unambiguous.

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 description gives an explicit when-to-use signal ('when Codex made things worse') and a pre-call requirement: confirm with the user unless they already asked for the rollback. It doesn't explicitly name alternatives or state when not to use it, but the context is clear enough for an agent to route correctly.

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

Install Server

Other Tools

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/Marczelloo/agent-router-mcp'

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