Skip to main content
Glama

util_text_chunk

Read-only

Text chunker for RAG and embeddings — Split long text (URL-encoded; roughly 12,000 chars fits in a GET URL, hard cap 30,000) into model-sized chunks for embeddings, RAG or long-document prompts. Breaks on paragraph, then sentence, then word boundaries; size = target tokens per chunk (default 400), overlap = shared tokens between chunks (default 10%), by = auto|paragraph|sentence|word. Each chunk is an exact substring with character offsets and an estimated token count. Offline and instant. Price: $0.001 USDC (Base, via x402).

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>",
      "size": "<size>",
      "overlap": "<overlap>",
      "by": "<by>"
    },
    "name": "util_text_chunk"
  }
}

Input Schema

NameRequiredDescriptionDefault
byYesauto
sizeYes
textYesFirst paragraph of a long document... Second paragraph...
overlapYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.3/5.0
Behavior4/5

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

Annotations cover only safety (readOnly=true, destructive=false), while the description adds the costly-but-valuable details: boundary fallback order, default chunk sizing, exact-substring output with character offsets, and the x402 micropayment. One tension: annotations declare openWorldHint=true while the description says 'Offline and instant', which suggests no external interaction — noted but not treated as a direct contradiction since it concerns the tool's environment, not its effect.

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 purpose and limits, then defaults, then output shape, then price — a sensible ordering for a single dense paragraph. It is information-dense rather than padded, though the pricing and encoding caveats are stacked into the same block, slightly reducing scannability.

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?

With no output schema, the description does explain the return value (each chunk is an exact substring with character offsets and an estimated token count), which is what an agent needs to consume results. Remaining gaps are minor: no pagination/response-size guidance for the 30,000-char case and no mention of how the 400-token default interacts with the URL length cap.

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 only 50% and the schema's own parameter descriptions are nearly useless ("auto", "400", "40"), so the description carries the load: it defines size as target tokens per chunk (default 400), overlap as shared tokens (default 10%), and enumerates by = auto|paragraph|sentence|word even though the schema declares no enum. Gaps remain — it does not reconcile the schema's numeric-looking string types or the overlap default of 40 shown in the schema versus 10% in the text.

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 ('Text chunker ... split long text into model-sized chunks') and names the concrete downstream uses (embeddings, RAG, long-document prompts). An agent can distinguish this from ai_embed (which produces vectors) or text_summarize (which condenses) without opening any schema.

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?

Usage context is explicit — use it to prepare text for embeddings, RAG or long-document prompts — and hard input limits (roughly 12,000 chars via GET URL, 30,000 cap) tell the agent when the tool is not viable. It never names an alternative sibling to route to, and the $0.001 USDC price is disclosed but no 'when not worth it' guidance is given.

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