Skip to main content
Glama
koraynar

doc-extract-mcp

by koraynar

chunk_document

Split long PDF or text documents into ordered, overlapping chunks with page hints, so each segment fits within a context window for further processing.

Instructions

Split a document's text into ordered, overlapping chunks.

Useful for long documents that do not fit one context read. For PDFs the text keeps its '--- page N ---' markers and each chunk carries a 'page_hint' (the page active at the start of the chunk); for other types 'page_hint' is null.

Args: path: File path inside the allowed root. max_chars: Maximum characters per chunk (default 4000). overlap: Characters repeated between consecutive chunks (default 200, must be smaller than max_chars).

Returns a list of {index, start_char, page_hint, text} in document order.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
overlapNo
max_charsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations, the description must carry the full behavioral burden. It discloses PDF-specific page markers and page_hint behavior, the overlap constraint (must be smaller than max_chars), and the return structure. It could note that it is read-only, but that is implied. Overall it is transparent about key behaviors without contradictions.

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 well-structured with a purpose sentence, a usage note, a behavior note, an Args section, and a Returns statement. It is lean with no redundant wording and front-loads the core purpose, making it easy for an agent to scan.

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?

The description covers purpose, usage, parameters, behavior, and return format. It even describes the output structure (list of {index, start_char, page_hint, text}) despite an output schema being available. There are no obvious gaps for an agent to call this tool correctly.

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%, so the description must fully explain the parameters. It does: 'path' is the file path inside the allowed root, 'max_chars' is the maximum chunk size, and 'overlap' repeats characters between chunks, with the constraint that overlap must be smaller than max_chars. This adds significant meaning beyond the bare 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 states a specific verb (split) and resource (document's text), producing ordered, overlapping chunks. It also notes the tool is for long documents that don't fit one context read, implicitly distinguishing it from read_document and other siblings. This is more than adequate for purpose clarity.

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 explicitly says 'Useful for long documents that do not fit one context read,' giving a clear when-to-use scenario. However, it does not name alternative tools or state when not to use it, so it misses the full 5-level guidance of explicit exclusions and named alternatives.

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