Skip to main content
Glama
anonymize-mcp

anonymize-mcp

by Buggy1111

anonymize

Production-grade pseudonymizace českých právních textů (v0.6.0).

Instructions

Production-grade pseudonymizace českých právních textů (v0.6.0).

Pipeline (8 kroků):

1. **Regex pre-pass** (`regex_pre_pass=True`) — strukturovaná PII
   (telefon, IČO, RČ, č.j., sp. zn., e-mail, URL, PSČ, SPZ, IBAN, DIČ,
   OP, datovka) se anonymizuje **PŘED** MasKITem, aby nebyly fragmentovány.
   Telefon "777 123 456" se anonymizuje **celý** jako jeden blok TELEFON1.

2. **Strict wrapper pre-pass** (`strict=True`) — NameTag najde
   firmy/úřady/instituce, které MasKIT vynechává nebo fragmentuje,
   a anonymizuje je sentinely → FIRMA1, INSTITUCE1.

3. **MasKIT** — pseudonymizace zbývajících PII (jména, adresy, ...).

4. **Stop-list filter** (`stop_list_filter=True`) — MasKIT občas
   chybně nahrazuje běžná slova ("stát" → "UniAgentury", "sporu" →
   "Pardubic"). Wrapper detekuje a vrátí originál, přidá warning.

5. **Restore sentinely** → finální placeholdery (TELEFON1, FIRMA1, ...).

6. **Fragmentation warnings** — detekce známých MasKIT problémů.

7. **Type classification** — NameTag dohledá typ entity pro každou náhradu.

8. **Placeholder mode** (`placeholder_mode=True`) — místo MasKIT náhodných
   fake names (`Jan Novák`) použij deterministické `OSOBA1`, `OSOBA2`...,
   `MESTO1`, `ULICE1`, ... S dedupingem: Jiří × 15× v textu → OSOBA1 × 15×.
   **Reprodukovatelné** (stejný vstup → stejný výstup) a **auditovatelné**.

Args:
    text: Vstupní text (čeština).
    output: Formát výstupu — ``txt`` (default), ``html``, ``conllu``.
    keep_mapping: Default ``False`` (od v0.10.8). ``True`` vrátí i tabulku
        originálů (``replacements``) a mezivýsledek ``raw`` — **originály tak
        uvidí i AI, která nástroj volá**. Zapni jen pro zpětné doplnění údajů
        v důvěrném prostředí.
    classify_types: NameTag dohledá typ entity. Default ``True``.
    strict: Wrapper pre-pass na firmy/úřady. Default ``True``.
    placeholder_mode: ⭐ **NEW v0.6.0** — deterministic placeholdery
        místo MasKIT fake names. Pro reprodukovatelnost a auditovatelnost.
    regex_pre_pass: Default ``True``. Strukturovaná PII regexem PŘED MasKITem.
    stop_list_filter: Default ``True``. Rollback MasKIT false positives.
    audit_block: Default ``critical`` (od v0.10.10). Když kontrola po anonymizaci
        najde nezakrytý kritický údaj (IBAN, karta, rodné číslo s platným
        kontrolním součtem, API klíč), nástroj **vrátí chybu místo textu**.
        ``high`` zadrží i e-maily a telefony, ``off`` jen varuje.

Returns:
    ``anonymized`` (čistý text), ``warnings``; jen s ``keep_mapping=True``
    navíc ``raw`` (mezivýsledek, může obsahovat originály) a ``replacements``
    (list s ``original``, ``placeholder``, ``type``, ``source``),
    ``warnings``, ``sources`` ({maskit, wrapper-regex, wrapper-strict,
    wrapper-placeholder}).

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": "anonymize"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYes
outputNotxt
strictNo
audit_blockNocritical
keep_mappingNo
classify_typesNo
regex_pre_passNo
placeholder_modeNo
stop_list_filterNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.10.9
    • addedInput schema / properties / audit_block
      Added value: +{
      +  "default": "critical",
      +  "enum": [
      +    "critical",
      +    "high",
      +    "off"
      +  ],
      +  "title": "Audit Block",
      +  "type": "string"
      +}
    • changedInput schema / properties / keep_mapping / default
      Previous value: -trueNew value: +false
  2. First observedv0.1.0

TDQS

A4.7/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 behavioral burden and does so richly: it discloses that audit_block returns an error instead of text when critical data survives, that keep_mapping exposes originals to the calling AI, that stop_list_filter rolls back false positives with warnings, and that placeholder_mode is deterministic and reproducible. It also enumerates which PII categories each pre-pass covers and what warnings/fragmentation detection occur.

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?

Purpose is front-loaded and the numbered pipeline is easy to scan, with each step mapping to a real parameter or behavior. It is lengthy and carries some non-essential packaging (version numbers, emoji, inline examples) and duplicates the Returns section that the output schema already provides.

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 9-parameter, 8-stage redaction pipeline, everything an agent needs is present: inputs, defaults, failure mode, safety caveats about exposing originals, and the shape of the response. The output schema exists, yet the extra Returns description adds matching detail rather than contradicting it.

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

Parameters5/5

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

Schema coverage is 0%, so the description must compensate and it does: all 9 parameters are explained with their defaults (keep_mapping False, audit_block critical, strict/regex_pre_pass/stop_list_filter True, placeholder_mode, classify_types, output formats txt/html/conllu) plus the semantics of what each toggle changes in the pipeline. This is meaning well beyond the bare schema titles and enum values.

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?

Names a specific verb (pseudonymization/anonymization) and a specific resource (Czech legal texts), and the 8-step pipeline makes the scope concrete. An agent can immediately distinguish this from siblings like extract_entities or correct_text, which transform rather than redact.

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

Usage Guidelines4/5

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

Gives conditional guidance for risky settings, e.g. keep_mapping should be enabled 'only for backfilling data in a trusted environment', and audit_block levels are explained by severity (critical/high/off). It never names an alternative sibling tool or states when not to use anonymize, so explicit routing guidance is absent.

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