Skip to main content
Glama

Restore an older version of a document

restore_document
DestructiveIdempotent

Deletes data: puts a replaced version of a packing list or an invoice back as the current document, as the person who connected this app, and records it in the organization's audit log. The version that replaced it becomes the older one, and the data imported from it (a packing list's pallets and boxes, an invoice's lines) is deleted and replaced by what the restored version says. Use it only when the user asks to go back to the earlier file, and say which version you will bring back. Get the id of a replaced version from list_documents with view "superseded". Refused, with nothing changed, when the shipment has arrived, when boxes are pre-allocated on the current packing list (delete those pre-allocations first), and for a document that cannot be rebuilt this way (a bill of lading: replace it with replace_document instead). Restoring a document that is already current changes nothing. Answers with the restored document.

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": {
      "document_id": "<document_id>"
    },
    "name": "restore_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
document_idYesThe replaced version to bring back, such as "doc_45", from list_documents with view "superseded".

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.7/5.0
Behavior5/5

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

The annotations declare destructiveHint=true and idempotentHint=true, and the description adds the substance behind them: exactly what is destroyed (a packing list's pallets and boxes, an invoice's lines), that the action is attributed to the connecting user and written to the audit log, that it is a no-op on the already-current document, and which preconditions cause a refusal with nothing changed. This is rich behavioral context beyond the structured fields.

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?

The "Deletes data:" prefix front-loads the most important fact, followed by effect, confirmation obligation, id discovery, refusals, and no-op case, each in its own sentence with no filler. Despite being dense, every clause carries operational information an agent needs.

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 one-parameter destructive mutation with no output schema, the definition covers effect, side effects, attribution, audit logging, preconditions, refusals, the no-op case, and the return value ("Answers with the restored document"). There is no meaningful gap an agent would hit when invoking it.

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 coverage is 100% and the single parameter's schema description already says the id comes from list_documents with view "superseded". The description reinforces that it must be the replaced version being brought back, but adds no format or syntax detail the schema lacks, so the 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 (put a replaced version back as the current document) and immediately scopes it: it restores a document, not a shipment or alert, and it names replace_document as the different tool for documents that cannot be rebuilt this way. An agent can distinguish it from its sibling without opening either schema.

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 explicit when-to-use (only when the user asks to go back to the earlier file), an obligation to state which version is being restored, the exact path to discover the id (list_documents with view "superseded"), three named refusal conditions, and the alternative tool (replace_document) for bills of lading. Nothing about selection is left to inference.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources