Skip to main content
Glama

Count Text

count_text
Read-onlyIdempotent

Count characters, words, lines, and UTF-8 bytes for text (≤8000 chars). Latin words + CJK ideographs counted separately; pure algorithm, no upstream. Returns characters, characters_no_whitespace, words, lines, bytes_utf8. Cost: 1 credit per call, charged by mcp-credit-gateway before forwarding. Privacy: Text is processed in-memory for this request only and is not stored. Do not send secrets, passwords, or personal data you would not paste into a public tool. Calls are rate-limited/metered by mcp-credit-gateway and require a valid sk_live_ key. (文本仅在本请求内存中处理、不落盘;请勿提交密钥/密码等敏感信息;调用限频。)

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

Input Schema

NameRequiredDescriptionDefault
textYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only cover the read-only/idempotent safety profile; the description adds what they cannot: 1-credit cost charged by mcp-credit-gateway before forwarding, rate limiting, sk_live_ key requirement, and in-memory-only processing with no storage. It even warns against submitting secrets, which is unusually actionable behavioral context.

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, then limits, output shape, cost, and privacy in a sensible order. Minor waste: the mcp-credit-gateway metering is stated twice, and the Chinese parenthetical largely duplicates the privacy and rate-limit lines already in English.

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?

With no output schema, the description enumerates the return fields (characters, characters_no_whitespace, words, lines, bytes_utf8), and for a single-parameter tool it covers cost, auth, limits, and privacy. Nothing an agent needs to invoke it correctly 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 0% and the schema itself carries no descriptions, so the description must compensate — it does, by defining the length ceiling and exactly how 'words' and 'bytes_utf8' are interpreted (Latin words and CJK ideographs separately). It does not explain the minLength=1 constraint or handling of trailing newlines, so it is not fully exhaustive.

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 ('count') and precise resources (characters, words, lines, UTF-8 bytes), plus the counting rules ('Latin words + CJK ideographs counted separately; pure algorithm, no upstream'). No sibling tool in the list performs counting, so the agent can route immediately.

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?

Makes the call context clear ('pure algorithm, no upstream') and flags the 8000-char cap, which effectively tells the agent when this is viable versus chunking. It never names an alternative or an explicit when-not-to-use case, so it stops short of a 5.

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.