Skip to main content
Glama
sandraschi

pdf-mcp

pdf_analyze

Read-only

Detect whether a PDF contains a text layer or is scanned, then return layout and character statistics to guide OCR or extraction.

Instructions

Detect whether a PDF has a text layer (digital) or is scanned, with layout stats.

Return Format

A dict with keys:

  • success: bool

  • pages: int

  • has_text_layer: bool - true when average chars per page >= 80

  • scanned: bool - low text + images present

  • chars_per_page: float

  • total_chars: int

  • image_count: int

  • layout_hint: str - digital | scanned | empty

  • per_page: list of {page, chars, images}

Examples

await pdf_analyze(path="scan.pdf") {"success": true, "pages": 5, "has_text_layer": false, "scanned": true, "chars_per_page": 12.4, "image_count": 5, "layout_hint": "scanned", "per_page": [...]}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesPath to the PDF file.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageNoHuman-readable summary
successNoWhether the operation succeeded

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.1

TDQS

B3.2/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, so the safety profile is covered. The description does add real behavioral value by disclosing the detection heuristics (has_text_layer when avg chars/page >= 80; scanned when low text plus images), but it says nothing about auth needs, file-path constraints, or failure behavior for invalid PDFs.

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

Conciseness3/5

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

The opening sentence is front-loaded and tight, and the example is useful. However, the lengthy '## Return Format' block substantially duplicates the declared output schema, which is redundant length rather than earned content.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-parameter, read-only diagnostic with an output schema and a worked example, an agent has everything needed to invoke it correctly. The only real gap is routing guidance against the many pdf_* siblings.

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?

Only one parameter (path), and schema description coverage is 100%, so the schema fully documents it. The description adds no syntax, path-format, or constraint detail for the parameter, making 3 the correct baseline.

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?

States a specific verb and resource: detects whether a PDF has a text layer or is scanned, plus layout stats. This is clearly distinct from manipulation/export siblings, though it never names an alternative such as pdf_extract or pdf_classify to sharpen 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 Guidelines2/5

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

The description never says when to call this tool versus alternatives. Usage is only implied by the detection goal; there is no stated precondition (e.g. run before OCR/extraction) and no mention of siblings like pdf_extract or pdf_validate.

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