Skip to main content
Glama

Extract PDF to Markdown

pdf_extract

Extract local PDFs into Markdown, preserving headings, lists, and tables. For long documents, specify pages to avoid truncation; check warnings for unreliable text.

Instructions

Extract a local PDF to Markdown, preserving headings, lists and tables. Output is TRUNCATED by default to protect your context window — to read a long document, call repeatedly with the pages parameter rather than raising maxChars. Call pdf_classify first on unfamiliar documents. If the response carries a critical warning (encoding issues, no text layer, right-to-left script), the text is unreliable and must not be quoted as fact.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute path, or path relative to an allowed root, of a .pdf file
pagesNo1-indexed page numbers to extract. Omit for the whole document. Prefer this over raising maxChars.
compactNoCollapse dot leaders and source padding for token efficiency. Defaults to true.
maxCharsNoTruncation ceiling. Defaults to the server setting (40000).
Behavior5/5

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

No annotations exist, so the description carries the full burden. It discloses default truncation to protect context window, explains the recommended pagination strategy, and warns about critical failure conditions (encoding issues, no text layer, right-to-left script) where output must not be quoted as fact. This is rich behavioral disclosure.

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?

Three sentences, each earning its place: the first states purpose, the second covers truncation and usage guidance, the third delivers warning/reliability information. It is front-loaded with the core action and contains 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?

Despite having no output schema or annotations, the description covers the essential aspects: output format (Markdown), truncation behavior, pagination strategy, warning handling, and prerequisite classification. It provides complete context for a 4-parameter extraction tool.

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?

The schema covers 100% of parameters with detailed descriptions, earning a baseline of 3. The description adds practical value by specifically recommending pages over maxChars for long documents, clarifying the intended usage of these parameters 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?

The description clearly states the tool's function: 'Extract a local PDF to Markdown' with specific preservation of headings, lists, and tables. This specific verb-resource-output combination distinguishes it from sibling tools like pdf_search and pdf_tables, which serve different purposes.

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?

The description provides explicit guidance: 'Call pdf_classify first on unfamiliar documents' and advises using the pages parameter repeatedly rather than raising maxChars for long documents. This gives clear context and an explicit alternative workflow, exceeding basic requirements.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/vishalmeena2211/pdf-triage-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server