Skip to main content
Glama

scrub_pdf_metadata

Idempotent

Strip hidden PDF metadata and embedded scripts by rewriting a clean single-revision PDF-1.7 file, optionally removing annotations or forms while preserving page content.

Instructions

Losslessly rewrite a clean single-revision %PDF-1.7 file (collapsing multiple %%EOF saves into 1 %%EOF with a fresh xref table), stripping /Info, XMP /Metadata, /PieceInfo, /JavaScript, /OpenAction, /EmbeddedFiles, and optional /Annots or /AcroForm while preserving active vector page content.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "scrub_pdf_metadata"
  }
}

Input Schema

NameRequiredDescriptionDefault
filePathNoLocal filesystem path to the source .pdf file (provide filePath or pdfBase64).
pdfBase64NoBase64-encoded source PDF binary when scrubbing in memory.
outputPathNoOptional destination filesystem path to write the scrubbed %PDF-1.7 binary.
stripAnnotsNoWhen true (default), removes all /Annots reviewer comments and unapplied /Redact annotations.
returnBase64NoWhen true, includes the scrubbed PDF as Base64 in the JSON tool response.
stripAcroFormNoWhen true, removes interactive /AcroForm form dictionaries from the catalog.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.8/5.0
Behavior5/5

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

Goes well beyond the annotations by enumerating exactly which objects are destroyed, stating what is preserved ("active vector page content"), and describing the rewrite/refactor of incremental revisions. With destructiveHint=false and readOnlyHint=false already declared, this text supplies the real payload: the precise destruction list an agent needs before invoking.

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?

One dense sentence, front-loaded with the verb and outcome, and every clause adds information (revision collapsing, stripped objects, preservation guarantee). The nested parentheticals and hex-escape notation make it slower to parse than ideal, but nothing is filler.

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?

Covers the transformation thoroughly and annotations carry the safety profile, so no output schema is strictly required. However, with zero required parameters the definition never states what happens if neither filePath nor pdfBase64 is supplied, nor how outputPath and returnBase64 interact in the response, leaving an agent to guess at failure modes.

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 coverage is 100%, so all six parameters are already documented, including per-flag defaults. The description only echoes the optional /Annots and /AcroForm stripping, adding no syntax, precedence, or interaction detail (e.g. filePath vs pdfBase64 vs outputPath) beyond the schema, so the baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Names a specific verb ("Losslessly rewrite") plus the exact resources removed (/Info, XMP /Metadata, /PieceInfo, /JavaScript, /OpenAction, /EmbeddedFiles, /Annots, /AcroForm) and the mechanism (%%EOF collapsing with fresh xref). It is highly specific, but it never differentiates itself from the sibling tools (audit_pdf_forensics, compile_clean_burned_pdf), so an agent must infer the boundary.

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?

Usage is only implied via preconditions: the input must be a "clean single-revision %PDF-1.7 file," and /Annots and /AcroForm stripping is flagged as optional. There is no explicit when-to-use vs alternative statement and no exclusion guidance, leaving selection between this and compile_clean_burned_pdf to inference.

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