Skip to main content
Glama

Put a document back the way it was

restore_doc

Undo a write to a document and put back the passage it replaced. Refuses if the document changed since that write, so later edits are never lost.

Instructions

Undo a write to a document. Changing a passage and replacing a body keep what they replaced, and this puts it back; adding to the end keeps nothing, and neither do the person's own saves. Refused unless the document still reads as that write left it — going back would undo whatever came after — with even_if_more to go back over all of it once you have read the document and know that is what you want. What it puts back is kept in turn, so calling it twice leaves the document where it started, which makes it safe to try. Reach for it the moment a write comes back saying something you did not expect, instead of retyping the document from memory.

Input Schema

NameRequiredDescriptionDefault
docYesThe document's id, as `docs` hands it back — an opaque name like `q7ntmzbm-0001`, not its title — or a task's id, to put back the assistant's notes on its page as they were before the last write
even_if_moreNoGo back even when the document has been written since the kept body was set aside, undoing that writing too. Only when you know what has happened to it — the refusal without this names the risk, and the person may be what was written since

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior5/5

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

With no annotations, the description carries the full behavioral burden and does so well: it distinguishes which write types are recoverable (passage edits, body replacements) from those that are not (appends, the user's own saves), states the refusal condition and its risk rationale, and notes that repeated calls are idempotent so it is 'safe to try.' This is exactly the mutation semantics an agent needs.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The key action is front-loaded, but the body is a dense, em-dash-heavy run-on that mixes reversibility rules, refusal conditions, escalation, idempotency and usage trigger into nearly one breath. The metaphorical language costs comprehension relative to a short bulleted statement of the same facts.

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 two-parameter mutation tool with no annotations and no output schema, the description covers recoverability, blocking conditions, the override, idempotency and the calling trigger. Return values need not be explained given no output schema exists; only the shape of a refusal is left partially implicit.

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 baseline is 3. The description adds the context that even_if_more overrides a refusal and may undo the user's own later work, but that risk is also spelled out in the parameter's own schema description, so most of this is restatement.

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?

Opens with a specific verb+resource: 'Undo a write to a document,' which clearly separates it from write_doc, edit_doc, append_doc and archive_doc. The rest of the description reinforces the restore semantics, though the metaphorical phrasing ('kept body set aside') blurs the core statement somewhat.

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?

Gives an explicit trigger ('the moment a write comes back saying something you did not expect') and a stated alternative to avoid ('instead of retyping the document from memory'). It also documents the refusal precondition and the even_if_more escalation path, but never names the sibling tool an agent should use instead.

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