Skip to main content
Glama

Document Tools

Count words and characters

count_text
Read-onlyIdempotent

Use this when the user asks how long a text is, for example "how many words is this", "character count for this tweet", "will this fit in one SMS", "how long does this take to read". Pass the text exactly as written, at most 20,000 characters. Returns characters, characters without spaces, graphemes (user-perceived characters), words, sentences, paragraphs, lines, UTF-8 bytes, SMS encoding and segments, reading minutes, and Flesch reading ease and grade level (English only; null otherwise), with the rules used for each count. The text is not stored.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesThe text to count, exactly as the user wrote it (at most 20000 characters, about 3,500 words).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
smsNo
linesNo
rulesNo
wordsNo
graphemesNo
sentencesNo
charactersNo
paragraphsNo
utf8_bytesNo
reading_minutesNo
flesch_reading_easeNo
characters_no_spacesNo
flesch_kincaid_gradeNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already establish the safe read-only, idempotent profile, and the description still adds real behavioral facts beyond them: the 20,000-character cap, that the text is not stored (a privacy guarantee), and that Flesch metrics are English-only and null otherwise. Those are exactly the constraints an agent needs and cannot derive from structured fields.

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?

Front-loaded with the when-to-use clause, then constraints, then the return list, then the non-persistence note. Every sentence carries information; the return enumeration is long but dense rather than padded.

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 an output schema present, the description need not explain return values, yet it summarizes them anyway alongside the limit and English-only caveat. For a single-parameter, annotated, read-only tool, nothing an agent needs to call 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 100% and the single parameter is fully documented there, so the baseline would be 3. The description still adds value by stressing 'pass the text exactly as written' (preserving whitespace/punctuation matters for counting accuracy) and restating the upper bound, which sharpens correct invocation.

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 resource (text), plus the exact classes of user request it answers ('how many words is this', 'will this fit in one SMS'). Nothing in the sibling set competes, and the purpose is unmistakable without opening the 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?

Opens with an explicit trigger condition and four concrete example phrasings that map to specific counting modes (words, tweet length, SMS fit, reading time). It does not name when NOT to use it or point to an alternative, but no sibling tool does overlapping work, so the gap is minor.

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