Skip to main content
Glama

Segment Chinese text

segment
Read-only

Split Chinese text into words using jieba, with precise, full, or search modes and optional HMM discovery for out-of-dictionary terms.

Instructions

Split Chinese text into words with jieba.

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": "segment"
  }
}

Input Schema

NameRequiredDescriptionDefault
hmmNoUse the HMM model to discover words not in the dictionary.
modeNoprecise: the most likely single segmentation (default, best for analysis); full: every dictionary word that can be formed, overlapping; search: precise mode plus sub-words of long words, for search indexing.precise
textYesChinese text to process.

Output Schema

NameRequiredDescriptionDefault
modeYesMode used.
countYesNumber of tokens.
tokensYesTokens in order, whitespace removed.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.2/5.0
Behavior2/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, so safety is covered and the description's only added behavior is naming jieba as the engine. It says nothing about mode trade-offs, HMM cost, performance on long inputs, or how out-of-dictionary words behave — the things that would actually guide invocation.

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?

A single front-loaded sentence with no wasted wording; the core action comes first and the qualifier (Chinese text, jieba) follows.

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 an output schema handling return values, full schema coverage handling parameters, and annotations covering safety, the description's shortfall is mainly guidance and sibling differentiation rather than missing essentials. An agent could call it correctly, but less confidently about alternatives.

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 mode enum is documented in detail within the schema, so the description need not repeat it. Baseline 3 applies: the description adds no meaning beyond the structured parameter docs.

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?

States a specific verb and resource ("Split Chinese text into words") plus the engine (jieba), so the operation is unambiguous. It does not, however, distinguish itself from siblings such as pos_tag, which likely also segments, or add_user_words, which modifies the dictionary segmentation depends on.

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

Usage Guidelines2/5

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

There is no when-to-use or when-not guidance: nothing tells the agent when to pick segment over pos_tag, extract_keywords, or convert_chinese, nor any prerequisite such as loading user words first. Usage must be inferred from the name and the mode enum alone.

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