文本统计
count_textCounts characters, graphemes, code points, lines, paragraphs, sentences, words, and Unicode scripts in inline text or files/directories; returns only numbers and paths, never content.
Instructions
统计文件或文本的字素/码点/UTF-16 单元数、字素簇、行、段落、句子、词数以及按 Unicode 脚本分类的字符计数。返回纯数字与路径,绝不返回正文片段。
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "count_text"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | No | 直接统计一段文本;与 paths 二选一。 | |
| unit | No | 字符计量单位(结果中所有字符级指标都会给出,rules.unit 反映该选择)。 | grapheme |
| paths | No | 要统计的文件路径数组(可含目录);与 text 二选一。目录会按 include/exclude 递归过滤。 | |
| exclude | No | 目录递归时的排除模式(支持 ** 与 *)。 | |
| include | No | 目录递归时的包含模式(支持 ** 与 *)。 | |
| language | No | 分词/断句所用 locale;auto 时文本含 CJK 用 zh,否则 und。 | auto |
| maxBytes | No | 单文件字节数上限,超过则不读取(warning: file_too_large)。服务端硬上限 200MB,超过会被自动钳制(warning: max_bytes_clamped)。 | |
| wordsForCjk | No | 中文/日文/韩文是否也返回分词数(近似)。默认 false,即 CJK 文本 words=0。 | |
| maxBytesForWordCount | No | 单文件字节数上限,超过则跳过 words 与 sentences(warning: skipped_word_segmentation)。服务端硬上限 64MB,超过会被自动钳制(warning: max_bytes_clamped)。 |