Skip to main content
Glama
anki-workflow-mcp

anki-workflow-mcp

by Gugart43

Export Final

export_final

Exports a validated batch transactionally: verifies the receipt and re-validates inputs, writes final QA/Cloze CSV files and manifest under one deck lock, and rolls back on failure.

Instructions

Final transactional export of a validated batch; the SOLE writer of the final CSV files and of the Manifesto post-export. Requires the content_hash returned by pipeline_gate_check / validate_batch on PASS. Order: receipt check and full re-validation (read-only) → under one deck lock: ID checks, staged writes, replace, manifesto save; any failure rolls files back. Re-running with the same receipt on an exported batch returns ALREADY_EXPORTED and writes nothing. Parameters: deck_dir; batch_id; qa_csv; cloze_csv; receipt_hash; new_ids_json (JSON array of {id, batch, type, status, topic, anchor}); new_topics_json (JSON array of strings); changelog_json (JSON array of changelog objects); topic_slug (optional, e.g. 'EscleroseMultipla'); write_to_deck_root (also copy into the deck root, default True). Writes: deck_dir/exports/{batch_id}[_{topic_slug}]_QA.csv and _Cloze.csv.

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": {
      "deck_dir": "<deck_dir>",
      "batch_id": "<batch_id>",
      "qa_csv": "<qa_csv>",
      "cloze_csv": "<cloze_csv>",
      "receipt_hash": "<receipt_hash>"
    },
    "name": "export_final"
  }
}

Input Schema

NameRequiredDescriptionDefault
qa_csvYes
batch_idYes
deck_dirYes
cloze_csvYes
topic_slugNo
new_ids_jsonNo[]
receipt_hashYes
changelog_jsonNo[]
new_topics_jsonNo[]
write_to_deck_rootNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.1

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations supplied, the description carries the full burden and delivers: it discloses the execution order (read-only re-validation, then ID checks under a deck lock, staged writes, replace, manifesto save), failure semantics ('any failure rolls files back'), and idempotency behavior. This is far more than the annotations would have provided had they existed.

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 identity and exclusivity claim, then prerequisites, then mechanics, then parameters — a sensible ordering. It is a dense run-on paragraph with no line breaks, and the inline parameter dump is long, but every clause carries operational information rather than 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 10-parameter transactional writer, the description covers prerequisites, ordering, locking, rollback, idempotency, and the exact write destinations. Return values need not be explained because an output schema exists. An agent has everything it needs to call this correctly and safely.

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 description coverage is 0%, so the description must compensate, and it largely does: it enumerates all ten parameters, gives the element shape for new_ids_json ({id, batch, type, status, topic, anchor}), specifies new_topics_json/changelog_json as JSON arrays, notes topic_slug is optional with an example value, and states the default for write_to_deck_root. Minor gap: deck_dir, batch_id, qa_csv, cloze_csv, and receipt_hash get no gloss beyond their names, and it is unclear whether qa_csv/cloze_csv are input paths or output targets.

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?

Uses a specific verb+resource ('Final transactional export of a validated batch') and immediately differentiates it from every sibling by claiming exclusivity: 'the SOLE writer of the final CSV files and of the Manifesto post-export.' It also states the exact output paths, so the agent knows precisely what artifact this tool produces.

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?

Gives an explicit precondition ('Requires the content_hash returned by pipeline_gate_check / validate_batch on PASS') and names the exact sibling tools that must run first. It also spells out the re-run policy ('Re-running with the same receipt on an exported batch returns ALREADY_EXPORTED and writes nothing'), which covers the main misuse case.

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