Skip to main content
Glama

scrub_pii

Detect and redact personally identifiable information (PII) from Word documents using Presidio and spaCy NER. Use dry-run mode to review detections before applying redaction as black rectangles.

Instructions

[EXPERIMENTAL] Detect and redact PII from the open document using Presidio + spaCy NER.

WARNING: This tool WILL miss PII. It is experimental and NOT suitable for production use or as the sole control for privileged, regulated, or legally sensitive documents. Always run with dry_run=True first and manually review every detected entity before committing a redacted file.

Known limitations (statistical NER gaps):

  • Names in ALL-CAPS (ledger headers, table cells) are frequently missed.

  • Single-token names with no surrounding context are unreliable.

  • Non-English names (Arabic, CJK, African) have low recall on this English model.

  • Names embedded in legal boilerplate ("Borrower: Jane Doe") are often skipped.

NER model (en_core_web_lg, ~560MB) downloads automatically on first use.

Detects: PERSON, EMAIL_ADDRESS, PHONE_NUMBER, CREDIT_CARD, SSN, IP_ADDRESS, IBAN_CODE, US_BANK_NUMBER, US_PASSPORT, and more via Presidio.

Redacted text is replaced with a solid black DrawingML rectangle — true XML redaction where the original text is deleted from the OOXML entirely, not merely hidden by formatting.

Args: output_path: Destination path. Required when dry_run=False. entities: Presidio entity types to redact. None = all detected types. confidence_threshold: Presidio score floor (default 0.35). dry_run: If True, detect only — return entity list, write no file. also_sanitize_metadata: Apply level-3 metadata sanitization (default True). redact_authors_as: Replacement author string for metadata pass.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
output_pathNo
entitiesNo
confidence_thresholdNo
dry_runNo
also_sanitize_metadataNo
redact_authors_asNoREDACTED

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations provided, the description bears full responsibility for behavioral disclosure. It honestly states the tool is experimental, has low recall for certain names (ALL-CAPS, non-English, etc.), automatically downloads a large NLP model, and performs true XML redaction (deleting text, not hiding). It does not mention whether the document is saved automatically or if the user must save separately, but overall it provides substantial behavioral context.

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?

The description is somewhat lengthy but well-structured with sections (WARNING, Known limitations, model info, detection types, redaction method, Args). It is front-loaded with the critical warning. Every sentence adds value, though the list of detected entity types could be omitted or placed in the schema. Nonetheless, it remains efficient for the complexity involved.

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?

Given the complexity (experimental, many limitations, 6 parameters) and the presence of an output schema (so return values need not be explained), the description covers everything necessary: purpose, risks, workaround (dry_run), parameter details, and behavioral nuances. It is comprehensive and leaves no major gaps for an AI agent.

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 description coverage is 0%, yet the description includes a detailed 'Args' section explaining each parameter's purpose, default values, and behavior (e.g., 'entities: None = all detected types', 'dry_run: detect only – return entity list, write no file'). This adds significant meaning beyond the schema's type/default fields, fully compensating for the lack of schema descriptions.

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?

The description clearly states the tool's function: 'Detect and redact PII from the open document using Presidio + spaCy NER.' This is a specific verb ('detect and redact') and resource ('PII from open document'), distinguishing it from sibling tools like redact_text (manual regex redaction) and sanitize_metadata (metadata cleanup). The purpose is unambiguous and well-differentiated.

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?

The description provides explicit usage guidance: it warns that the tool is experimental and not production-ready, advises running with dry_run=True first, and outlines the need for manual review. It also lists known limitations to help the agent decide appropriateness. However, it does not explicitly compare to sibling tools like redact_text or sanitize_metadata, leaving some decision-making to the agent. Overall strong but not perfect.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/SecurityRonin/docx-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server