Skip to main content
Glama
sandraschi

pdf-mcp

pdf_redact

Destructive

Blacken sensitive content in a PDF by exact terms or PII patterns such as emails, phones, and card numbers, returning the output path and a count of redacted regions.

Instructions

Blacken sensitive content in a PDF by terms and/or PII patterns.

Return Format

A dict with keys:

  • success: bool

  • path: str - output PDF path

  • occurrences: int - number of regions redacted On failure: {success: False, error}.

Examples

await pdf_redact(path="report.pdf", pii=True) {"success": true, "path": ".../report_redact_....pdf", "occurrences": 7}

await pdf_redact(path="report.pdf", terms=["Acme Corp"]) {"success": true, "path": ".../report_redact_....pdf", "occurrences": 3}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
piiNoRedact PII (email, phone, IBAN, card, SSN, IP). Default false.
pathYesPath to the PDF file to redact.
termsNoExact phrases to blacken.
output_pathNoOutput path. Auto-generated if omitted.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageNoHuman-readable summary
successNoWhether the operation succeeded

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.1

TDQS

A3.7/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true and openWorldHint=true, so the safety profile is covered structurally. The description adds the return contract (success/path/occurrences and the failure shape), which is useful, but says nothing about permissions, whether the source file is modified, or file-size/page limits.

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 core purpose is front-loaded in a single sentence, followed by a compact return contract and two examples that each earn their place. The Return Format section partially duplicates the existing output schema, which is the only mild redundancy.

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

Completeness4/5

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

For a four-parameter mutation tool with full schema coverage and an output schema, the description is sufficient: purpose, return contract, and worked examples are all present. It could be richer on side effects (whether the original PDF is preserved) but nothing essential for correct invocation is missing.

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 all four parameters are already documented in the schema and the baseline is 3. The description's mention of 'terms and/or PII patterns' and the examples reinforce how the parameters combine, but add no syntax or format detail beyond the schema.

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 specific verb and resource ('Blacken sensitive content in a PDF') plus the two mechanisms ('terms and/or PII patterns'), which cleanly separates it from every other pdf_* sibling such as pdf_annotate or pdf_extract. An agent can identify the operation without opening the schema.

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?

The two examples imply the two modes (pii=True for pattern-based redaction, terms=[...] for exact phrases), which is useful implied guidance, but there is no explicit statement of when to choose this tool over pdf_annotate or pdf_manipulate, and no preconditions or exclusions are given.

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