Skip to main content
Glama

chunk_text

Chunk markdown documents into retrieval-ready pieces with doc-type-aware splitting, auto-detecting structure or forcing a specific type, and control over target, min, and max token sizes.

Instructions

Chunk a markdown document into retrieval-ready pieces.

Picks a doc-type-aware chunker (paper / book / manual / qa / resume / table / default) based on document structure. Set doc_type to force a specific chunker; default "auto" runs structural detection.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesthe markdown content to chunk. (To chunk a FILE, first run `parse(source)` then pass `result["markdown"]` here.)
doc_typeNo"auto" | "paper" | "book" | "manual" | "qa" | "resume" | "table" | "default". Default "auto".auto
max_tokensNohard cap before force-split (default 800).
min_tokensNoundersize threshold for trailing-chunk merge (default 50).
target_tokensNotarget chunk size in whitespace-tokens (default 400).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A3.7/5.0
Behavior3/5

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

With no annotations, the description must disclose behavior. It mentions the automatic selection of chunkers based on document structure and the token thresholds for splitting/merging. However, it does not detail error conditions, edge cases, or what happens when doc_type is invalid. The behavior of auto-detection is noted but not elaborated sufficiently.

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 concise, two sentences, with the core purpose front-loaded. It introduces the key concept of auto-detection and the doc_type override efficiently. No unnecessary filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (multiple doc types, token thresholds) and the presence of an output schema, the description is adequate but not rich. It explains the core behavior but omits details about how doc_type influences output, what 'retrieval-ready' implies, and potential errors. The output schema likely covers return structure, but more context on chunker selection logic would improve completeness.

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 input schema covers all parameters with 100% description coverage, including defaults and constraints. The description adds only a minor note about file handling (via parse) that is also in the schema. It does not compensate beyond what the schema already provides, so baseline 3 is appropriate.

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?

Description states a specific verb ('chunk') and resource ('markdown document') with a clear output goal ('retrieval-ready pieces'). It also mentions the doc-type-aware chunker selection, which distinguishes it from siblings like parse or detect_doc_type. The purpose is unambiguous.

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 implies usage (chunking text) and hints at pre-processing via the parameter note about parse, but it does not explicitly contrast with alternatives or state when not to use it. It offers some guidance through the doc_type parameter but lacks explicit usage context relative to sibling tools.

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