Skip to main content
Glama

history_purge

Destructive

Delete Word document undo history for privacy, either the whole log or entries before a UTC date. Run a dry run first to get a confirm token, then purge.

Instructions

Delete undo history for privacy: the whole log (all) or entries before a date (before, ISO 8601, UTC), of the document or of an orphaned store. Two steps: run with dry_run to see what would go and get a confirm token, then repeat with confirm; a log that changed in between is refused. Leaves a tombstone entry; backups are not removed by it. Destructive: purged entries can no longer be undone or restored. Use history.list first to check what you remove.

Input Schema

NameRequiredDescriptionDefault
allNoRemove the whole log.
docNoPath to the .docx.
storeNoA store folder (see history.orphans) to read instead of the document's own.
beforeNoRemove entries older than this ISO date or time (UTC).
confirmNoFrom the dry run.
dry_runNoList what would go; returns confirm.

Output Schema

NameRequiredDescriptionDefault
okYesAlways true on success.
opYesThe operation that ran.
apiYesAPI version (1.0).
docNoThe document read or written: path, sha256 and paragraph count.
nextYesCursor for the next page (pass as cursor), or null.
resultYesWhat the operation returns.
warningsYesThings to know about the result.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.7.2
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "api": {
      +      "description": "API version (1.0).",
      +      "type": "string"
      +    },
      +    "doc": {
      +      "description": "The document read or written: path, sha256 and paragraph count.",
      +      "properties": {
      +        "characters": {
      +          "description": "text.normalize of a text string: its length.",
      +          "type": "integer"
      +        },
      +        "paragraphs": {
      +          "description": "Body paragraphs.",
      +          "type": "integer"
      +        },
      +        "path": {
      +          "description": "Path of the document.",
      +          "type": "string"
      +        },
      +        "sha256": {
      +          "description": "sha256 of the file (pass as expect.sha256 to a write).",
      +          "type": "string"
      +        },
      +        "source": {
      +          "description": "A .txt/.md/.odt source's format, encoding and split mode; \"text\" for a text string (text.normalize).",
      +          "type": [
      +            "object",
      +            "string"
      +          ]
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "next": {
      +      "description": "Cursor for the next page (pass as cursor), or null.",
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "ok": {
      +      "description": "Always true on success.",
      +      "type": "boolean"
      +    },
      +    "op": {
      +      "description": "The operation that ran.",
      +      "type": "string"
      +    },
      +    "result": {
      +      "description": "What the operation returns.",
      +      "properties": {
      +        "confirm": {
      +          "description": "Token to pass as confirm to really purge.",
      +          "type": "string"
      +        },
      +        "dry_run": {
      +          "description": "True when nothing was written (a preview).",
      +          "type": "boolean"
      +        },
      +        "first_op_id": {
      +          "description": "Oldest entry removed.",
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "last_op_id": {
      +          "description": "Newest entry removed.",
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "removed": {
      +          "description": "Entries removed (0 on a dry run).",
      +          "type": "integer"
      +        },
      +        "scope": {
      +          "description": "What is removed: all, or before <time>.",
      +          "type": "string"
      +        },
      +        "tombstone": {
      +          "description": "Op id of the purge entry left in the log.",
      +          "type": "string"
      +        },
      +        "would_remove": {
      +          "description": "Entries the scope covers.",
      +          "type": "integer"
      +        }
      +      },
      +      "required": [
      +        "dry_run",
      +        "scope",
      +        "removed",
      +        "would_remove",
      +        "confirm"
      +      ],
      +      "type": "object"
      +    },
      +    "warnings": {
      +      "description": "Things to know about the result.",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "api",
      +    "ok",
      +    "op",
      +    "result",
      +    "warnings",
      +    "next"
      +  ],
      +  "type": "object"
      +}
  2. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true, and the description goes well beyond them: it discloses the two-step confirm protocol, the mid-flight change refusal, that a tombstone entry remains, that backups are NOT removed, and that purged entries can no longer be undone or restored. This is exactly the behavioral context a mutation tool needs.

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?

A single dense paragraph that front-loads the mode selection and then the destructive/confirm mechanics. Every sentence carries information, though the level of detail makes it slightly heavier than needed.

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 destructive, six-parameter mutation tool, the description covers scope, safety workflow, side effects, and prerequisites. An output schema exists, so return-value explanation is legitimately omitted. Nothing needed 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?

Schema coverage is 100%, so baseline is 3. The description adds genuine meaning: `before` is ISO 8601 in UTC, `store` is an orphaned store (pointing to history.orphans), and `confirm`/`dry_run` are coupled as a token round-trip. It clarifies interaction between params rather than merely restating them.

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+resource (delete undo history) and immediately scopes the two modes (whole log via `all` vs entries before a date via `before`), plus the doc-vs-store targeting. An agent can distinguish it from history_undo, history_restore, and history_list without opening a 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?

Prescribes the exact workflow: run with dry_run first to see what would go and obtain a confirm token, then repeat with confirm. It also recommends history.list as a pre-check and warns that a log changed between steps is refused. Explicit when/how-to-use with an alternative named.

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