Skip to main content
Glama

Put a document back the way it was

restore_doc
Destructive

Undo the last write to a document, restoring a changed passage or whole write, and block the restore if later edits exist unless explicitly overridden.

Instructions

Undo the last write to a document: a changed passage or a whole write is put back; appends and the person's saves keep nothing to undo. Refused if written since, unless even_if_more. Undoing twice returns it. Use it when a write answers something unexpected, instead of retyping.

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": {
      "doc": "<doc>"
    },
    "name": "restore_doc"
  }
}

Input Schema

NameRequiredDescriptionDefault
docYesA document's id, not its title, or a task's to put back the assistant's notes on its page
even_if_moreNoGo back over what was written since too; only once you read it and know, since the person may have written it

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.43.2
    • changedInput schema / properties / doc / description
      Previous value: -"The 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"New value: +"A document's id, not its title, or a task's to put back the assistant's notes on its page"
    • changedInput schema / properties / even_if_more / description
      Previous value: -"Go 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"New value: +"Go back over what was written since too; only once you read it and know, since the person may have written it"
  2. First observed

TDQS

A4.1/5.0
Behavior5/5

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

The annotations only say this is a destructive, non-idempotent write; the description adds substantive behavior beyond them. It discloses refusal semantics: a restore is refused if the document was written since, unless even_if_more is set. It identifies which prior actions produce no undo state, and it notes that undoing twice 'returns it,' consistent with idempotentHint=false. That is real operational context an agent needs before invoking a destructive call.

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

Conciseness4/5

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

The description is three dense sentences with the core action front-loaded and the exception and trigger following in a logical order. Every clause carries information, though 'a changed passage or a whole write is put back' and 'Undoing twice returns it' are slightly compressed to the point of ambiguity. It is efficient overall.

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?

There is no output schema and only two parameters, and the description covers the essential behavior: what is reverted, when the call is refused, what the override does, and the repeat-call behavior. What it does not state is what a successful call returns or how the caller confirms completion. That is a minor omission for a tool of this complexity.

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 both doc and even_if_more are already documented, including the warning that the person may have written since. The description reinforces even_if_more through the refusal rule ('Refused if written since, unless even_if_more'). That adds only marginal meaning beyond the schema, so the baseline of 3 applies.

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 names a specific verb and resource reversal: 'Undo the last write to a document,' and it scopes it to a changed passage or a whole write. That makes clear it is a revert operation, distinct from sibling tools such as edit_doc or write_doc. The phrasing 'a write answers something unexpected' is idiosyncratic, but the core action is 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?

It gives a concrete when-to-use trigger: 'Use it when a write answers something unexpected, instead of retyping.' It also states a when-not condition: appends and the person's saves leave nothing to undo. It does not name sibling tools directly, so it does not reach the explicit-alternative level of a 5, but a caller can decide without opening the schema.

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