Skip to main content
Glama

chunk_for_rag

Split documents into RAG-ready chunks with Docling's HybridChunker. Produces token-aware segments with page, headings, and type info for accurate retrieval.

Instructions

Chunk a document for RAG using docling's HybridChunker.

Returns list of {text, index, page, headings, chunk_type, token_count}.

Args: source: Local path / URL / data URI. chunk_size: Target max tokens per chunk. overlap: Overlap tokens between adjacent chunks. tokenizer: HuggingFace tokenizer name. Defaults to BGE-small (English). Use a multilingual tokenizer (e.g. "bert-base-multilingual-cased") for non-English docs. ocr_languages: Override default OCR languages.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourceYes
overlapNo
tokenizerNoBAAI/bge-small-en-v1.5
chunk_sizeNo
ocr_languagesNo

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 carries the full burden. It discloses the return format (list of dicts with fields), the default tokenizer, and provides guidance for multilingual documents. It does not explicitly state whether the operation is read-only or requires network access for tokenizer downloads, but it covers the most important behavioral aspects for a chunking tool.

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 and concise: a clear first line, a return format line, and a clean Args block. Every sentence adds value; there is no redundancy or fluff. It is appropriately sized for the tool's complexity.

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?

The description is complete enough for an agent to invoke the tool correctly: it covers the tool's purpose, return values, and all parameters with defaults and usage notes. It lacks error-handling or edge-case details, but these are not critical for a chunking tool. The output schema is not shown, but the return format is explicitly described.

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?

Schema description coverage is 0%, so the description must compensate. It explains all five parameters: source (path/URL/data URI), chunk_size, overlap, tokenizer (with default and multilingual hint), and ocr_languages (as override). The only gap is that ocr_languages is underspecified (no details on format or acceptable values), but overall it adds substantial meaning beyond the schema titles.

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 a specific verb ('Chunk') and resource ('a document for RAG'), and explicitly mentions using docling's HybridChunker. It distinguishes itself from sibling tools like convert_to_text and extract_tables by focusing on chunking rather than conversion or extraction.

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 a clear context: chunking for RAG. It implicitly signals when to use this tool (when chunks are needed for retrieval), but it does not explicitly mention alternatives or exclusion criteria. However, the purpose is specific enough that an agent would know to use it for chunking rather than the conversion siblings.

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/mk20mm/docling-mcp'

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