Skip to main content
Glama

Inspect a PDF

pdf_info
Read-only

Inspect a PDF to report page count, metadata, text-layer presence, scanned status, and table of contents. Use this first to choose text extraction or page rendering and jump to chapters.

Instructions

Open a PDF and report what it is: page count, document metadata, whether it has a real text layer, and its table of contents.

Call this first, before pdf_read or pdf_render_page. It tells you which reading strategy works:

  • hasTextLayer true → pdf_read returns the actual text, page by page.

  • scanned true → the pages are images with no text at all. pdf_read cannot help; use pdf_render_page to render pages and read them visually.

The returned toc lists top-level entries with the page each one starts on, so you can jump straight to the chapter a question is about instead of paging through the document.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesPath to the PDF (absolute, or relative to the server root).
toc_limitNoHow many top-level outline entries to include (default 40).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, so the safety profile is covered. The description adds genuinely new behavioral context: the return shape (hasTextLayer, scanned flags, toc with page numbers) and the TOC's role in navigation. It stops short of noting failure modes such as encrypted or corrupt PDFs, so it is not a 5.

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?

Front-loaded purpose sentence followed by two short, high-signal blocks: a routing rule and a TOC usage note. Every sentence changes what the agent does; no filler or repetition of the schema.

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?

There is no output schema, and the description compensates by naming the return fields an agent must branch on. Combined with full schema coverage and existing annotations, nothing needed to call this correctly before reading a PDF is missing.

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 description coverage is 100% and both parameters are documented in the schema, so the baseline is 3. The description's mention of 'top-level entries' and the page each starts on adds marginal meaning to toc_limit, but no default, format, or interaction detail beyond the schema.

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?

States a specific verb+resource ('Open a PDF and report what it is') and enumerates the exact outputs (page count, metadata, text layer, TOC). It also distinguishes itself from sibling tools by name (pdf_read, pdf_render_page), so an agent can route without opening any schema.

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?

Explicitly says 'Call this first, before pdf_read or pdf_render_page' and then gives decision rules keyed to outputs: hasTextLayer true → pdf_read; scanned true → pdf_read cannot help, use pdf_render_page. This is when-to-use plus when-not-to-use plus named alternatives.

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