Skip to main content
Glama

Generate overlapping text chunks with character offsets

text_chunk
Read-only

Split a long text into chunks for retrieval (RAG): split on paragraphs, then sentences, then words, each chunk within maxTokens (default 500) with the overlap you ask for (default 50 tokens). Each chunk has its index, text, start and end character offsets and an estimated token count (characters divided by 4, a rough rule for English). Up to 1 MB and 2,000 chunks. Related tools on this server, for a different need: text_diff when you need to find differences between two texts by line, word or character; text_faq when you need to generate FAQ pairs grounded in a text with checked quotes. Price: $0.002 per successful call, paid with x402 (USDC on Base, Solana and 10 more networks); failed calls are not charged.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "text": "<text>"
    },
    "name": "text_chunk"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYesThe text, up to 1 MB (JSON body field)
overlapNoTokens shared by neighbouring chunks, 0 up to maxTokens minus 1, default 50
maxTokensNoLargest chunk in estimated tokens, 20 to 8000, default 500

Output Schema

NameRequiredDescriptionDefault
countNo
chunksNo
sourceNo
overlapNo
checkedAtNo
maxTokensNo
tokenEstimateNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior4/5

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

Annotations only supply readOnlyHint and openWorldHint; the description adds real behavior the annotations cannot: the fallback splitting order, hard limits of 1 MB and 2,000 chunks, the chars/4 token estimate, and the fact that each chunk carries index, offsets and token count. It also discloses billing semantics ($0.002 per successful call via x402, failed calls not charged), which matters for an open-world paid tool. Minor gap: no note on ordering guarantees or determinism of the estimate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the purpose, then output shape, limits, alternatives, and pricing in a logical order. Dense but nearly every clause carries information; the payment-network enumeration ("USDC on Base, Solana and 10 more networks") is the one part that costs more length than it returns.

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?

An output schema exists, so return values need not be explained, yet the description still outlines chunk fields, which helps. For a three-parameter, read-only, paid text utility, it covers purpose, limits, defaults, token semantics, billing and sibling routing — nothing an agent needs is missing.

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 coverage is already 100% and documents ranges and defaults, so the baseline is 3; the description earns more by explaining what a "token" means here (characters divided by 4, a rough English rule), which is the key to interpreting maxTokens and overlap. It restates the defaults, which is redundant with the schema, but the heuristic adds genuine meaning.

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?

States a specific verb and resource ("Split a long text into chunks for retrieval (RAG)") and specifies the splitting cascade (paragraphs, then sentences, then words). It explicitly separates itself from the named siblings text_diff and text_faq by describing their different purposes.

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

Usage Guidelines5/5

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

Gives the selecting condition up front (RAG chunking) and routes the agent away with "for a different need: text_diff when... text_faq when...", each with its own trigger condition. The agent can choose among these three tools without opening another definition.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources