Skip to main content
Glama
mcp-toolkit

mcp-toolkit

by Dongnb66

text_chunk

Split long text into overlapping chunks by character size, preferring sentence-ending breaks, to prepare documents for retrieval-augmented generation.

Instructions

RAG 文本切块:把长文本按 chunkSize 切成若干片段,支持 overlap 重叠,优先在句末断点切割。适合做检索增强的预处理。

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
textYes待切块的原始文本
overlapNo相邻块重叠字符数,默认 50
chunkSizeNo每块最大字符数,默认 500

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description carries the full disclosure burden. It adds a genuinely behavioral detail beyond the schema (it prefers splitting at sentence ends), but it omits whether the return value is an array of strings, how text shorter than chunkSize is handled, and whether overlap is clamped or allowed to exceed a chunk boundary.

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?

Two short sentences with the core operation front-loaded (what it does, then the parameters, then the fit). No filler, though the trailing suitability clause is softer than the operational content and could carry more of the when-to-use load.

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?

For a stateless, three-parameter transform with full schema coverage and no output schema, the description covers purpose, key parameters, and cutting strategy. The only meaningful gap is the shape of the returned chunks, which is inferable but not stated.

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?

Schema description coverage is 100% and the schema already documents defaults (50 overlap, 500 chunkSize) and constraints (overlap minimum 0, chunkSize exclusiveMinimum 0). The description only restates chunkSize and overlap without adding format or interaction semantics, for example whether overlap must be smaller than chunkSize; that is the baseline 3 case.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb and resource (RAG text chunking: splitting long text into segments by chunkSize) and states concrete mechanics (overlap, sentence-boundary preference). It does not need to distinguish itself from siblings such as date_calc or jwt_decode, which are unrelated; however, it never explicitly says no alternative tool exists for chunking.

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?

"适合做检索增强的预处理" (suitable for retrieval-augmented preprocessing) implies the use case, but the description gives no explicit when-not guidance or prerequisites and does not route the agent to any alternative. This is implied, not stated, usage guidance.

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