Skip to main content
Glama
sandraschi

pdf-mcp

pdf_extract

Read-only

Extract text, images, tables, metadata, fonts, links, and outlines from PDFs to retrieve structured content for analysis or processing.

Instructions

Extract content and metadata from a PDF.

Supports text, images, tables, metadata, fonts, links, and outline extraction through a single portmanteau tool.

Args are validated and documented via Annotated fields on the signature.

Return Format

A dict with keys:

  • success: bool - whether the operation succeeded

  • message: str - human-readable summary

  • operation-specific keys:

    • text: {text, pages, page_count}

    • images: {images: [{page, index, width, height, path, ext}]}

    • tables: {tables: [{page, rows, cols, headers, data}]}

    • metadata: {metadata: {...}}

    • fonts: {fonts: [{name, type, encoding, embedded, size}]}

    • links: {links: [{page, uri, page_target, rect}]}

    • outline: {outline: [{title, level, page, children}]} On failure: {success: False, error, error_type}.

Examples

await pdf_extract(operation="text", path="report.pdf", pages="1-3") {"success": true, "text": "...", "pages": 3, "page_count": 12, "message": "Extracted 3 pages of text from report.pdf."}

await pdf_extract(operation="metadata", path="report.pdf") {"success": true, "metadata": {"title": "Report", ...}, "message": "Extracted metadata from report.pdf."}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesPath to the PDF file.
pagesNoOptional page range (e.g. '1-5,7,9-12'). All pages if omitted.
operationYes

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.3/5.0
Behavior3/5

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

readOnlyHint=true already tells the agent this is a safe read operation. The description adds the return dict shape and the failure shape ({success: False, error, error_type}), which is useful, but since an output schema exists the return-format detail is partly redundant and no permissions, limits, or edge-case behavior are disclosed.

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?

Purpose is front-loaded, then operations, return format, and examples follow in a clear hierarchy. It runs long and duplicates the output schema in the Return Format section, but each block is scannable and relevant for a portmanteau tool.

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?

With an output schema present, the return-value documentation is not strictly needed, and the operation list makes invocation clear. However, against 16 sibling tools the description gives no routing guidance, leaving a real gap in knowing when this tool is the right choice.

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 67%; the operation enum has no schema description, but the description enumerates its values (text, images, tables, metadata, fonts, links, outline), compensating for that gap. path and pages are already documented in the schema, so the description does its job where coverage is missing.

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 ('Extract content and metadata from a PDF') and enumerates the seven extraction modes, so the agent understands the tool's scope precisely. It does not explicitly distinguish itself from siblings like pdf_rag or pdf_analyze, which prevents a 5.

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 choose pdf_extract over the many siblings (pdf_rag, pdf_analyze, pdf_convert, etc.) or when not to use it. 'Single portmanteau tool' implies consolidation but provides no decision criteria.

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