Skip to main content
Glama

恢复到某版

gwl_restore_document_revision

Restore a document body to a chosen revision by writing a new revision record, making rollback reversible; requires edit access and optional version lock.

Instructions

把文档正文恢复到某一版修订(会新写一条修订记录,因此本身可逆)。 需要可编辑权限(403),同样受乐观锁保护:建议带 version。 当前正文已经与该版一致时返回 400(重复调用不幂等)。

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_id": "<doc_id>",
      "rev": "<rev>"
    },
    "name": "gwl_restore_document_revision"
  }
}

Input Schema

NameRequiredDescriptionDefault
revYes要恢复到的修订号(路径参数)。
doc_idYes文档 id(路径参数)。
versionNo乐观锁基线版本;省略=不做版本校验。

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior5/5

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

The description goes well beyond the annotations. It explains that a new revision record is written and the operation is therefore reversible, which corroborates the false values for destructiveHint and readOnlyHint. It also discloses 403 permission requirements, the optimistic-lock expectation, and the non-idempotent 400 path, which is consistent with idempotentHint=false. This is exactly the kind of context annotations cannot carry.

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 short lines, front-loaded with the core action and its reversibility, followed by permission and lock constraints, then the error case. There is no wasted wording.

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?

An output schema exists, so returns need not be explained. The description covers the mutation semantics, permissions, locking, and the duplicate-call error. One edge case remains unstated: what happens when rev does not exist or is out of range. That is minor for a three-parameter tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3. The description adds a real operational recommendation that the schema does not state: include version so the optimistic lock applies. It does not add further meaning for rev or doc_id beyond the schema.

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: restore the document body to a given revision number. It clearly differs from get_document_revision (read) and restore_document (whole-document restore), although it never names those siblings explicitly. The purpose is unambiguous to an agent reading the description.

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 states prerequisites for use: editable permission (403) and an optimistic lock, with a recommendation to pass version. It also warns that the call is not idempotent, since a duplicate restore returns 400. It stops short of naming an alternative tool for the read-only case, but the calling conditions are clear.

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