Skip to main content
Glama
anki-workflow-mcp

anki-workflow-mcp

by Gugart43

Sanitize Card Field

sanitize_card_field

Sanitizes Anki card field text by converting inequalities, bare ampersands, pipes, and newlines to safe HTML entities while preserving valid HTML tags for safe Anki rendering.

Instructions

Sanitize a single card field: converts mathematical/clinical inequalities (< 10, > 50, <=, >=) to HTML entities (&lt;, &gt;, &le;, &ge;), bare &amp; to &amp;, pipes to |, newlines to , while strictly preserving valid HTML tags (, , , , , , , ). Returns sanitized string and list of fixes applied.

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": {
      "text": "<text>"
    },
    "name": "sanitize_card_field"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYes
is_images_fieldNo
convert_markdownNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.1

TDQS

A3.7/5.0
Behavior4/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 does so well: it discloses the exact conversions, the whitelist of preserved tags, and that the call returns both the sanitized string and the fixes applied, implying a non-destructive, report-producing operation. It stops short of stating idempotency or whether the stored card is written back.

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?

One dense, front-loaded sentence that puts the conversion rules first and the return value last, with zero filler. It is long but every clause carries usable information; a short structured split of rules versus returns would read even better.

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 transformation behavior is covered thoroughly and return values are backed by an output schema, so the core is complete. The gap is parameter coverage: two behavior-altering flags are undocumented, which is material for a tool whose output changes depending on whether it is an images field or whether markdown conversion is on.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% across three parameters, and the description mentions none of them. The two boolean flags, is_images_field and convert_markdown, are left entirely unexplained in either the schema or the description, so the agent must guess their semantics and defaults.

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 precise verb ('Sanitize') and resource ('a single card field'), then enumerates exactly which characters are converted and which HTML tags are preserved. An agent can distinguish this from validators like validate_tags_field or validate_images_field because it transforms rather than checks.

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: the description makes clear it operates on one field and handles raw inequality/bare-&/pipe/newline problems, from which an agent can infer when to reach for it. However, it names no alternative and gives no exclusion such as 'use batch_auto_fix for many fields' or 'run validate_* first'.

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