Skip to main content
Glama

snippet_revisions

Destructive

Read, retrieve, or restore earlier versions of a snippet's code, so an overwritten snippet is recoverable. Check existing code first, then roll back to any recorded revision.

Instructions

Read or roll back the history of a snippet. Every save that CHANGES the code writes a revision of what was there before, by agent or human alike — so an overwrite is recoverable. Actions: list (revision ids, timestamps, who, and the length of each — not the code), get (the full code of one revision, by revision_id), restore (put a revision back, by revision_id). A restore goes through the normal save path, so it is linted, front-end checked, and itself recorded as a revision — you can always walk back out. Use this BEFORE re-writing a snippet you did not author in this session: read what is there rather than assuming your version is still live.

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": {
      "id": "<id>"
    },
    "name": "snippet_revisions"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesThe snippet id.
limitNoHow many revisions to list. Default 20, max 200.
actionNolist
revision_idNoRequired for get and restore. Comes from action=list.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.1.2

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the bare destructiveHint=true annotation: it explains that revisions are only written on actual code changes, that restore runs through the normal save path (linted, front-end checked) and is itself recorded as a revision, making the destructive action reversible. It also discloses that list returns metadata rather than code, which prevents wasted round-trips.

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?

Front-loads the purpose, then structures the three actions in a single dense line, then the guidance and the restore caveat. The repeated 'by revision_id' phrasing is slight redundancy, but no sentence is filler.

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 four-parameter tool with no output schema, the description covers return shapes for each action, the prerequisite for get/restore, and the safety story around restore. Nothing an agent needs to call it correctly is missing.

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?

Adds real meaning beyond the 75%-covered schema: list returns revision ids, timestamps, author, and length but not code; get returns the full code of one revision; restore takes a revision_id sourced from list. The limit parameter is left entirely to the schema, which is a minor gap only.

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?

Opens with a specific verb+resource ('Read or roll back the history of a snippet') and then enumerates the three concrete actions (list, get, restore) with what each does. An agent can distinguish this from snippet_get or snippet_save without opening any schema.

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 use case with a condition: 'Use this BEFORE re-writing a snippet you did not author in this session.' It implies the when-not case (snippets you authored yourself) and clearly separates the three internal actions, but it does not name a sibling tool as the alternative for reading current code versus history.

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