Skip to main content
Glama
shuji-bonji

pdf-verify-mcp

by shuji-bonji

Validate PDF/A and PDF/UA Conformance

validate_conformance
Read-onlyIdempotent

Check a PDF against PDF/A archive or PDF/UA accessibility standards to identify conformance failures before submission, with per-rule ISO clause results and violation details.

Instructions

Validate a PDF against a PDF/A flavour (ISO 19005, archiving) or a PDF/UA flavour (ISO 14289, accessibility).

Hybrid engine: when veraPDF is installed (PDF_VERIFY_VERAPDF env var or on PATH) validation is delegated to it for an authoritative result. Otherwise a built-in rule subset is checked natively:

  • PDF/A (15 rules): encryption, file ID, LZW, font embedding, JavaScript/prohibited actions, OutputIntent, transparency for A-1, XFA, and more

  • PDF/UA (12 rules): MarkInfo/Marked, StructTreeRoot, pdfuaid declaration, /Lang, DisplayDocTitle, document title, Figure /Alt, image tagging, heading hierarchy, table TH/TR, Link /Contents

Args:

  • file_path (string): Absolute path to a local PDF file

  • response_format ('markdown' | 'json'): Output format (default: 'markdown')

  • flavour (string, optional): e.g. "pdfa-2b", "pdfa-4", "pdfa-4f", "pdfua-1". Defaults to the XMP declaration (PDF/A wins when both are declared; fallback: pdfa-2b). PDF/A-4 has no A/B/U level, so there is no "pdfa-4b"

  • engine ('auto' | 'verapdf' | 'native'): Engine selection (default: 'auto')

  • password (string, optional): Password for an encrypted PDF. PDF/UA validation decrypts the document first so structure rules see real structures; permission-encrypted PDFs (empty user password) are decrypted automatically

When veraPDF does not run, the report says so before the numbers: authoritativeValidation.performed is false and names the reason ("not_installed", "configured_path_unusable" when PDF_VERIFY_VERAPDF points at something that is not executable, or "native_engine_requested"). A configured-but-unusable path is never silently replaced by another executable — with engine: "verapdf" it errors as VERAPDF_NOT_AVAILABLE.

Returns: Every report begins with a "scope" object - how far the reading got, not a verdict: whether the cross-reference chain could be walked to the end (chainStop), whether this tool had to rebuild the cross-reference table itself (reconstructed - when true, the table is this tool's reconstruction and not the one the file carries), how many objects and sections were read, and whether an encrypted document could be opened. Read it before the verdict: "no violations" over a rebuilt table is not the same statement as "no violations" over the file's own table.

Size (v0.29.0): violations lists at most 200 entries; failedRules and compliant are computed over all of them and violationsTruncated = { returned, total } says when the list was cut. JSON is never cut by length.

Per-rule results with ISO clause references. compliant is true/false for veraPDF; for the native engine, false means definitive violations were found and null means "no violations in the checked subset" (NOT certification). PDF/UA native violations carry a severity: only 'error' rules can prove non-conformance, 'warning' rules need human review. For an encrypted PDF that cannot be decrypted, structure-dependent PDF/UA rules are reported in skippedRules (not checked) rather than as violations. The PDF/A font-embedding rule looks at fonts that are actually rendered (text rendering mode 3 is invisible and needs no embedded program, ISO 32000-2 9.3.6); when the content streams cannot be read far enough to tell, that rule is reported in skippedRules instead of guessing.

Note: PDF/UA cannot be fully decided by machine — whether alt text is present is checkable, whether it is meaningful is not. Use pdf-reader-mcp's inspect_tags to examine the structure tree itself.

Examples:

  • Check whether a scanned archive PDF actually meets its declared PDF/A-2b

  • Verify a generated document is tagged and accessible before publishing (pdfua-1)

  • Find why a document fails PDF/A before submitting it to an archive system

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
engineNoValidation engine: "auto" (veraPDF when installed, else native subset), "verapdf" (require veraPDF), "native" (built-in rule subset).auto
flavourNoFlavour to validate against. PDF/A: "pdfa-1b", "pdfa-1a", "pdfa-2b", "pdfa-2u", "pdfa-3b", etc. PDF/A-4 takes no conformance level — use "pdfa-4", or "pdfa-4e" / "pdfa-4f" for the variants ("pdfa-4b" does not exist). PDF/UA: "pdfua-1", "pdfua-2". Omit to use the document's XMP declaration (PDF/A takes precedence when both are declared; falls back to pdfa-2b).
passwordNoPassword for an encrypted PDF (PDF/UA validation only — the document is decrypted before checking structure-dependent rules). Omit for permission-encrypted PDFs (an empty user password is tried automatically).
file_pathYesAbsolute path to a local PDF file (e.g., "/path/to/document.pdf")
response_formatNoOutput format: "markdown" for human-readable, "json" for structured datamarkdown

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.29.1

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, and idempotentHint=true, so the description's job is to add context beyond those. It does extensively: explains the hybrid engine selection (veraPDF vs native), how failures are reported (authoritativeValidation.performed and reason), the exact meaning of the 'scope' object, truncation behavior, severity levels for PDF/UA, and the handling of encrypted PDFs. No contradiction with annotations, and it provides a rich behavioral layer well beyond what annotations convey.

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 description is long but well-structured: it opens with a purpose statement, then engine details, an Args list, Returns section, a Note on limitations, and Examples. Each sentence carries information and there is no redundant padding. While length is high, it is justified by the tool's complexity; it earns a 4 rather than 5 because the length could be slightly tightened without losing meaning.

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?

Given the tool's complexity (hybrid engine, multiple flavours, varied return semantics, and truncation rules), the description is remarkably complete. It explains the return structure ('scope' object, violation list truncation, severity handling), addresses edge cases (encrypted PDFs, missing veraPDF, unreconstructable content streams), and even notes when rules are skipped rather than guessed. With no output schema present, the description carries the full burden of explaining return values, and it does so thoroughly. No important aspect seems missing for an agent to call the tool 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. The description adds meaningful semantics beyond the schema: it explains default flavour behavior (PDF/A precedence over PDF/UA, fallback to pdfa-2b), engine 'auto' behavior (delegates to veraPDF when installed), encryption handling for password (decryption before structure checks, empty user password tried automatically), and validation rules lists. This goes beyond the schema's terse field descriptions, justifying one point above baseline.

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 tool validates PDFs against PDF/A (ISO 19005, archiving) or PDF/UA (ISO 14289, accessibility), giving both the verb and specific resource. It distinguishes itself from likely siblings like identify_conformance (detection) and validate_clauses (different focus) by explicitly focusing on conformance validation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives clear context on when to use the tool (checking archive conformance, verifying accessibility before publishing) and provides three concrete examples. It also notes limitations (PDF/UA cannot be fully decided by machine) and directs users to pdf-reader-mcp's inspect_tags for deeper structure examination. However, it does not explicitly contrast with sibling validation tools, so a half-point is lost.

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