Skip to main content
Glama
shuji-bonji

pdf-writer-mcp

by shuji-bonji

Ensure Tagged (PDF/UA scaffold & repair)

ensure_tagged
Idempotent

Add missing PDF/UA-1 document-level tags and, for untagged PDFs, create a minimal structure tree to make content accessible. Human review is required for headings, tables, and alt text.

Instructions

Put an existing PDF onto the PDF/UA-1 "vessel". If it is already tagged, the structure tree is untouched and only missing document-level requirements are supplied (MarkInfo / Lang / DisplayDocTitle / XMP pdfuaid:part and dc:title). For untagged documents, a minimal structure tree (each page = one P element) is created so the content becomes reachable by assistive technology. IMPORTANT: machines cannot infer meaning — headings, tables, lists, reading order and figure alt text are NOT created. The new tree is a scaffold, not an accessible document; it needs human review. If you can build the structure right from the start, use the create tools' tagged: true. For signed PDFs, preserveSignatures: true (approval signatures only; certification signatures are refused).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
langNoNatural language of the document (BCP 47, e.g. "ja"). Required by PDF/UA-1 7.2.
titleNoDocument title (required by PDF/UA-1 7.1). Falls back to the existing Info Title.
inputPathYesAbsolute path of the target PDF.
outputPathNoDestination file path (absolute). When omitted, a base64 string is returned instead.
returnBase64NoWhen true, include a base64 string in the result in addition to saving.
preserveSignaturesNoEdit a signed PDF via an incremental update (appending) without invalidating existing signatures. Default false. The original bytes are untouched, so /ByteRange holds. Changes beyond the certification (DocMDP) permission level are refused.
allowBreakingSignaturesNoWhen the target is digitally signed (detected via /ByteRange), the default is an error. Set true to proceed, accepting that the signatures become invalid.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.21.2

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the annotations, the description explains exactly what mutates: tagged files get only document-level requirements, untagged files get a minimal per-page P-element tree. It also discloses the critical limitation that real semantics (headings, tables, lists, reading order, alt text) are not created and that human review is required. No contradiction with the annotations.

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?

The description is front-loaded with the core purpose, then branches into tagged vs untagged behavior, the important human-review warning, the alternative tool guidance, and signed-PDF handling. Every sentence carries useful decision-relevant information with no filler.

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?

For a mutation tool with no output schema, the description covers the important branches: already tagged, untagged, signed, and certification-restricted. Output behavior is handled by the schema's outputPath/returnBase64 descriptions, so an agent has everything needed to invoke the tool correctly.

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?

The schema description coverage is 100%, so all seven parameters are already documented structurally. The description adds only incidental context around preserveSignatures and the lang/title mapping to PDF/UA requirements, not enough to raise it above the baseline for full 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 clearly states the action: putting an existing PDF onto the PDF/UA-1 'vessel' and repairing or scaffolding its tag structure. It distinguishes between already-tagged and untagged inputs, and explicitly contrasts itself with the create tools by mentioning their tagged: true option.

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?

It gives actionable selection guidance: use this when an existing PDF needs PDF/UA structure, and prefer the create tools with tagged: true when building structure from scratch. It also covers the signed-PDF branch by directing use of preserveSignatures: true and warning that certification signatures are refused.

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