Skip to main content
Glama

doc_revert

Destructive

Restore a document to a past revision as a new commit attributed to you; intermediate history stays, so the change can be reverted again.

Instructions

Restore a document to a past revision, as a new commit attributed to you: the history in between stays, so it can be reverted again. Check first with doc_history, doc_diff or doc_at. Refuses on remote mirrors (remotes/) and on a deleted doc: undo_run brings that back. To undo everything an agent did, use undo_run.

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": {
      "path": "<path>",
      "rev": "<rev>",
      "ai": "<ai>"
    },
    "name": "doc_revert"
  }
}

Input Schema

NameRequiredDescriptionDefault
aiYesYour AI family in lowercase (claude, chatgpt, gemini), not the model name. Attributes the change.
revYesThe revision to restore. Prefer a sha from doc_history: HEAD~N counts the whole mind's commits, not this doc's.
pathYesPath of the doc, e.g. notes/cdc.md.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv2.8.0
    • changedInput schema / properties / path / description
      Previous value: -"The doc."New value: +"Path of the doc, e.g. notes/cdc.md."
    • changedInput schema / properties / rev / description
      Previous value: -"A sha from doc_history, or HEAD~N."New value: +"The revision to restore. Prefer a sha from doc_history: HEAD~N counts the whole mind's commits, not this doc's."
  2. First observedv2.7.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations declare destructiveHint=true and openWorldHint=false, but the description adds the materially important nuance that the operation is non-destructive to history — intermediate commits remain and the revert can itself be reverted. It also discloses refusal conditions and the attribution side effect of the `ai` parameter. It stops short of saying what the call returns or whether it fails on conflicting paths, which keeps it from a 5.

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?

Front-loads the action in the first clause, then layers preconditions, refusals, and alternatives in descending priority. Every clause carries distinct information; the two undo_run references cover different cases (deleted doc vs. wholesale undo) rather than repeating.

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?

For a destructive, three-required-parameter mutation with no output schema, the description covers reversibility, exclusions, and prerequisites well. The notable remaining gap is the return value — with no output schema, the agent is not told whether it receives a new revision sha or a status object.

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 all three parameters are already documented in the schema, including the HEAD~N caveat and the ai-family format. The description's only added semantic is that the commit is "attributed to you," which largely restates the `ai` field's own description. 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?

States a specific verb and resource ("Restore a document to a past revision") plus the crucial mechanic that the restore lands as a new commit attributable to the caller. This is clearly distinguishable from doc_history/doc_diff (read/inspect) and from undo_run (bulk undo of agent activity), which are named explicitly.

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?

Gives an explicit pre-check recommendation ("Check first with doc_history, doc_diff or doc_at"), states two hard exclusions (remote mirrors under remotes/, deleted docs), and routes each exclusion to the correct alternative (undo_run). No inference required.

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