Skip to main content
Glama

Redact text

redact_pdf
Idempotent

Permanently remove specified words or phrases from a new PDF copy by covering each occurrence with a box and deleting the underlying text, so it cannot be selected, searched, or copied.

Instructions

Permanently blacks out (or whites out) every occurrence of the given words or phrases in a new copy of a PDF: each is covered with a box and the text underneath is removed from the file, so it cannot be selected, searched or copied. Use it for names, numbers or other content visible on the pages; for hidden information such as the author, use remove_metadata (often both before sharing), and use search_pdf first to check what will be hit. Something under a box that cannot be cut (an image or scan) is converted to an image when flatten_unsafe is true, otherwise left hidden and reported. Returns the number of occurrences redacted; nothing is written when none is found. The original is not changed, and an existing output file is only replaced with overwrite: true. Encrypted PDFs cannot be saved.

Input Schema

NameRequiredDescriptionDefault
pathYesAbsolute path of the PDF.
colorNoBox colour (default black).
termsYesWords or phrases to redact.
outputYesAbsolute path of the new PDF. If the file exists, the call fails unless overwrite is true.
passwordNoPassword, if the PDF is encrypted. Without it an encrypted PDF cannot be opened; with it, it can be read, but tools that write a new PDF cannot save it.
overwriteNoAllow replacing an existing file (default false).
match_caseNoOnly match the exact upper/lower case (default false).
flatten_unsafeNoConvert pages with content that cannot be cut to images (default false).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.1.0
    • addedInput schema / properties / match_case / description
      Added value: +"Only match the exact upper/lower case (default false)."
  2. Changed2 schema fields changedv1.0.9
    • changedInput schema / properties / output / description
      Previous value: -"Absolute path of the PDF to write."New value: +"Absolute path of the new PDF. If the file exists, the call fails unless overwrite is true."
    • changedInput schema / properties / password / description
      Previous value: -"Password, if the PDF is encrypted."New value: +"Password, if the PDF is encrypted. Without it an encrypted PDF cannot be opened; with it, it can be read, but tools that write a new PDF cannot save it."
  3. First observedv1.0.6

TDQS

A4.8/5.0
Behavior5/5

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

Annotations are mostly non-destructive/idempotent, and the description goes well beyond them: what is destroyed (text removed from the file), the flatten_unsafe fallback for images/scans, no-op behavior when nothing matches, original file untouched, overwrite-only replacement, and the encrypted-PDF write limitation. This is exactly the context annotations do not carry.

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?

Information-dense and front-loaded, leading with the core effect before routing advice and edge cases. It runs long across several clauses, but nearly every sentence carries operative detail (safety, return, encryption) rather than padding.

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?

No output schema exists, yet the description supplies the return value ('number of occurrences redacted; nothing is written when none is found'). With 8 params, a mutation target, and encryption/overwrite caveats all covered, an agent has everything needed to call it correctly.

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 coverage is 100%, so the baseline is 3, but the description adds real semantics the schema lacks: flatten_unsafe's effect on non-cuttable content ('converted to an image when flatten_unsafe is true, otherwise left hidden and reported'), the color black/white out behavior, and the overwrite:true replacement rule tied to untouched originals.

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 ('Permanently blacks out ... every occurrence of the given words or phrases in a new copy of a PDF') and immediately clarifies the physical effect (boxed, removed from the file, unselectable/unsearchable). It also contrasts itself with siblings remove_metadata and search_pdf, so an agent can route correctly without opening any schema.

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 explicit when-to-use ('names, numbers or other content visible on the pages'), names the alternative for the complementary case ('for hidden information such as the author, use remove_metadata') including the combined workflow ('often both before sharing'), and prescribes a pre-step ('use search_pdf first to check what will be hit').

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