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

reviews.getLatestId

reviews_getLatestId
Read-only

Returns the history ID for the last review matching an optional deck or card filter, or null if none matches. Use it to locate the target review record for history queries.

Instructions

Return the latest matching history ID or null.

Anki-Connect method reviews.getLatestId. Scope: collection. Effect: read. Completion: completed. Undo: none.

Possible errors: collectionUnavailable, internalError, invalidParams, notFound, 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": "reviews_getLatestId"
  }
}

Input Schema

NameRequiredDescriptionDefault
deckNoOnly reviews of cards in this deck: exactly one of {"id": "<deckId>"} or {"name": "<full deck name, e.g. Japanese::Verbs>"}. Mutually exclusive with `cardIds`.
cardIdsNoOnly reviews of these cards (decimal string, e.g. "1700000000001"). Mutually exclusive with `deck`.
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.
membershipNoHow `deck` is matched for cards in filtered decks: `current` = the deck the card is in now, `home` = its original (home) deck. Default `current`.current

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior4/5

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

Annotations already cover readOnly/openWorld/destructive, so the description's value is in what it adds: collection scope, undo: none, 'completed' completion semantics, the null return case, and an explicit error enumeration (collectionUnavailable, internalError, invalidParams, notFound, staleSession). The staleSession error is especially useful context that no annotation conveys.

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 one-line purpose followed by a compact structured block of scope/effect/completion/undo/errors. Minor redundancy: 'Effect: read' duplicates readOnlyHint and 'Undo: none' duplicates destructiveHint=false, though neither is costly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has four optional parameters, no output schema, and a filtered lookup. The description covers the return shape (ID or null) and failure modes, but leaves the core semantic gap: what a 'history ID' is, what 'latest' is ordered by, and what the agent is expected to do with the ID afterwards. That ambiguity matters for a tool whose entire output is one opaque identifier.

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 the schema already explains deck/cardIds mutual exclusion, the session token trade-off, and membership semantics in detail. The description adds only the word 'matching', which gestures at filtering without explaining how filters are combined or what happens when both are omitted.

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 states a specific verb and resource: 'Return the latest matching history ID or null.' It is distinguishable in shape from sibling reviews_list (which lists reviews rather than returning a single latest ID). However, 'history ID' and 'matching' are never grounded — an agent must infer this concerns review history entries and that 'matching' refers to the deck/cardIds filters.

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

Usage Guidelines2/5

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

There is no guidance on when to prefer this over reviews_list, or what the resulting ID is used for downstream. The only conditional guidance in the definition lives in the `session` parameter's schema description, not in the tool description itself.

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