Skip to main content
Glama
anki-connect-mcp
by SolarianGG

collection.undo

collection_undo
Destructive

Reverts the current Anki undo entry to restore a prior collection change, such as a deck, note, or card edit made by mistake.

Instructions

Undo the current Anki undo entry.

Anki-Connect method collection.undo. Scope: collection. Effect: write. Completion: operation. Undo: undo.

Long-running operation: by default the server waits for the final result (see waitForCompletion / timeoutSeconds).

Possible errors: collectionUnavailable, editorConflict, internalError, invalidParams, invalidState, staleSession.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "collection_undo"
  }
}

Input Schema

NameRequiredDescriptionDefault
sessionNoOptional. Collection session ID: the `session` field returned by `collection_get`. Usually omit it — the server then uses the session current at the time of the call. Pass it to make the call fail with `staleSession` instead of acting on a different profile/collection than the one your IDs, cursors and tokens came from.
timeoutSecondsNoMCP option (not sent to Anki): how long to wait for completion. A timeout does not cancel the work; the pending record is returned.
waitForCompletionNoMCP option (not sent to Anki): poll operations.get until the operation finishes and return its final record. If false, return the operation handle.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

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

With annotations already declaring destructiveHint=true and readOnlyHint=false, the description still adds real value: it labels the effect as a write, notes that the operation is itself undoable ('Undo: undo'), describes the default wait/poll behavior with the timeout-does-not-cancel caveat, and enumerates the specific error codes an agent may hit (staleSession, editorConflict, invalidState, etc.). It does not state what happens when the undo stack is empty or what the result record contains, so not a 5.

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-loaded with the core action, then structured label/value metadata, then caveats and error codes — easy to scan. The 'Effect: write' and 'Undo: undo' labels partially duplicate the annotations and error list is dense, but nothing is gratuitously verbose.

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?

For a zero-required-parameter mutation with annotations and no output schema, the description covers safety posture, long-running behavior, session semantics and failure modes. The remaining gap is the success-case outcome (what state changes, what the final operation record reports), which the agent must infer.

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 session, timeoutSeconds and waitForCompletion are already fully documented in the schema. The description only restates that a wait occurs and points at the two MCP options by name, adding no format or edge-case detail 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?

States a specific verb and resource ('Undo the current Anki undo entry') plus the underlying method (collection.undo) and scope (collection), which is enough to separate it from every sibling in the list. The word 'current' leaves slight ambiguity about which entry is targeted (most recent operation vs. an entry pointer), which keeps it from a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is only implied: an agent can infer this reverts the last collection-modifying action, but there is no explicit when-to-use or when-not guidance, and no mention of alternatives (e.g. scheduling_reset or manually reversing a change) if the undo stack is empty or the wrong entry would be reverted.

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

Deploy Server

Other Tools