Skip to main content
Glama

pdf_sanitize

Remove invisible threats from PDF files: JavaScript, auto-actions, form fields, annotations, and embedded files. Rewrites the file from reachable objects to eliminate orphaned data.

Instructions

Strip the invisible parts of a PDF (local path) before handing it out: JavaScript, open-actions and auto-actions, form fields, annotations and embedded files. The file is rewritten from its reachable objects afterwards, so orphaned remains are gone too – deleting references alone leaves them readable in the byte stream. The counterpart to pdf_redact: redact removes visible text, sanitize removes hidden payload. $0.01.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileYes
flattenNoFlatten annotations and form fields into the page
output_pathNo
idempotency_keyNo
remove_metadataNoAlso clear title, author and producer
remove_attachmentsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.7.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the full burden, and it explains the rewrite-from-reachable-objects mechanism and why orphaned bytes remain if references alone are deleted. It does not disclose whether the input file is overwritten in place or how auth or rate limits apply, but the mechanism disclosure goes beyond a typical one-liner.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences front-load the action and payload list, then provide the orphaned-bytes rationale and the redact contrast. No filler beyond the price tag, which is a minor but acceptable extra.

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 description covers purpose, mechanism, and sibling differentiation well, but with no output schema and a six-parameter surface it omits output-path semantics, idempotency, and in-place vs. copy behavior. It gives an agent enough to choose the tool, but not enough to invoke it correctly without inspecting the schema further.

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?

Only 33% of parameters have schema descriptions, and the description adds meaning only for file ('local path') and partially for flatten/remove_attachments through the enumerated payload. output_path, idempotency_key, and remove_attachments' behavior remain undocumented in both schema and description, so it does not fully compensate for the low schema coverage.

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 names a specific operation ('Strip') and target ('PDF'), enumerates the invisible parts (JavaScript, actions, form fields, annotations, embedded files), and explicitly contrasts it with pdf_redact. This makes it immediately distinguishable from siblings.

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?

States the context 'before handing it out' and identifies the alternative tool: 'The counterpart to pdf_redact: redact removes visible text, sanitize removes hidden payload.' This gives an agent an explicit decision rule between the two similar tools.

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