Skip to main content
Glama
ESPChong

context-retrieval

by ESPChong

extract_document_text

Extract structured text from a PDF, page by page, and receive JSON with page count, document metadata, and each page's text. Limit output by specifying pages like '1-3' or '1,5'.

Instructions

Extract structured text from a PDF, page by page (PyMuPDF). Returns JSON: page count, document metadata, and each page's text with 1-based page numbers — use pages='1-3' or '1,5' to limit output.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pagesNo
pdf_pathYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Install Server

TDQS

A4.2/5.0
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It discloses the implementation (PyMuPDF), the exact JSON return structure (page count, document metadata, per-page text with 1-based page numbers), and the page-range syntax. It does not mention edge cases like scanned PDFs or encryption, but for a read-only extraction tool this is solid coverage.

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?

Two sentences with no filler. The action is front-loaded, followed by output format and the one non-obvious parameter usage. Every sentence earns its place.

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 simple two-parameter tool with an output schema, the description covers the core purpose, the return structure, and parameter syntax. It does not mention error scenarios or ideal use cases relative to siblings, but nothing essential is missing for an agent to call it correctly.

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?

With 0% schema description coverage, the description must compensate. It explicitly documents the pages parameter with concrete syntax ('1-3' or '1,5'), while pdf_path is self-explanatory given the phrase 'from a PDF'. The description adds meaningful context that the raw schema lacks.

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 opens with a specific verb and resource ('Extract structured text from a PDF') and adds clarifying detail ('page by page', 'Returns JSON', '1-based page numbers'). The term 'text' clearly differentiates it from sibling tools focused on images and tables, so an agent can tell them apart.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

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

The description gives clear instruction on the pages parameter ('use pages=\'1-3\' or \'1,5\' to limit output') but does not explicitly state when to prefer this tool over siblings like extract_document_images or extract_document_tables. Tool-selection guidance is only implied by the word 'text' and the sibling names.

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

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/ESPChong/context-retrieval-system-RAG-MCP'

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