Skip to main content
Glama

read_pdf

Extract text or images from PDF files for vision LLMs, handling both text and scanned documents with configurable extraction modes.

Instructions

Read PDF content. Always prefer this over cat or file read for PDF files. Limits: 10 pages per request. Works with both text and scanned documents. Use 'image_only' to see actual page layout, or 'text_only' for pure text.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYesPDF file path (relative or absolute path)
start_pageNoStart page (1-indexed, inclusive)
end_pageNoEnd page (1-indexed, inclusive). None = last page
extraction_modeNoContent extraction mode: - 'auto' (default): Smart detection - extract text/tables, add page image only if corrupted - 'text_only': Extract text/tables only, no images - 'image_only': Skip text extraction, provide only full page imagesauto
filter_header_footerNoWhether to filter out header/footer images (top/bottom 6% of page)
crop_imagesNoWhether to crop images to max_image_dimension
max_image_dimensionNoMaximum image dimension in pixels (default: 842, A4 height)
page_image_dpiNoDPI for page image rendering (default: 100)
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key behavioral traits: the 10-page limit per request, compatibility with both text and scanned documents, and the distinction between extraction modes. However, it doesn't mention error handling, performance characteristics, or authentication requirements, which would be valuable for a tool with 8 parameters.

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 appropriately sized with four concise sentences that each serve a distinct purpose: stating the core function, providing usage preference, specifying limits/compatibility, and explaining mode options. It's front-loaded with the most important information. The only minor improvement would be integrating the page limit more naturally with the parameter explanations.

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?

Given the tool's complexity (8 parameters, no output schema, no annotations), the description does a good job covering the essential context. It explains the tool's purpose, when to use it, key limitations, and high-level mode options. However, for a tool with this many parameters and no output schema, it could benefit from mentioning what the return format looks like or providing more guidance on parameter combinations.

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?

The schema description coverage is 100%, so the schema already documents all 8 parameters thoroughly. The description adds minimal value beyond the schema - it mentions the 'image_only' and 'text_only' modes which are already in the schema's enum, but doesn't provide additional context about parameter interactions or usage patterns. This meets the baseline expectation when schema coverage is complete.

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 purpose with specific verbs ('Read PDF content') and distinguishes it from alternatives ('Always prefer this over cat or file read for PDF files'). It identifies the resource (PDF files) and differentiates from sibling tools like 'grep_pdf' and 'list_pdfs' by focusing on content extraction rather than searching or listing.

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 on when to use this tool vs. alternatives ('Always prefer this over cat or file read for PDF files') and offers specific usage contexts ('Use 'image_only' to see actual page layout, or 'text_only' for pure text'). It clearly directs the agent away from generic file operations for PDFs.

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/PyJudge/pdf4vllm-mcp'

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