Skip to main content
Glama
koraynar

doc-extract-mcp

by koraynar

read_document

Read and extract text from PDFs (with page selection and per-page markers), text, markdown, JSON, and CSV as formatted tables. Unsupported files return clear errors.

Instructions

Read a document and return its text content.

Supports .pdf (extracted per page with '--- page N ---' markers), .txt / .md / .json (read directly), and .csv (rendered as an aligned text table). Other types return a clear error.

Args: path: File path inside the allowed root. pages: Optional 1-indexed page selection for PDFs, e.g. '3', '1-5', or '1-3,7'. Empty string means all pages.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
pagesNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

With no annotations, the description carries full behavioral burden, and it excels: PDFs are extracted per page with '--- page N ---' markers, CSV is rendered as an aligned table, and unsupported types error. It also explains the pages argument's 1-indexed syntax and examples, offering far more context than the bare schema.

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?

The description is efficiently structured: a one-sentence summary, a compact list of supported formats, and an Args block that maps directly to the schema. Every sentence adds value, with format details and page syntax front-loaded before parameter specifics.

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?

For a two-parameter read tool with no annotations, the description covers all operational essentials: accepted types, per-format rendering rules, page selection syntax, and error behavior. An output schema exists, so return-value documentation is unnecessary, and nothing an agent needs for correct invocation is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, making the description the sole source of parameter meaning. It defines 'path' as a file path inside the allowed root and explains 'pages' with concrete examples like '3', '1-5', and '1-3,7', plus the default of empty string meaning all pages.

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-resource pair ('Read a document and return its text content'), immediately clarifying the tool's function. It further specifies supported formats and states that other types return an error, which distinguishes it from sibling tools like list_documents or document_info.

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

Usage Guidelines4/5

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

The description provides clear context by enumerating supported file types and noting that unsupported types return a clear error, giving an implicit when-not-to-use. However, it does not explicitly name alternative tools for metadata or chunking tasks, such as document_info or chunk_document, so the guidance relies on inference rather than direct exclusions.

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/koraynar/doc-extract-mcp'

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