Skip to main content
Glama

Count words and characters

count_text
Read-onlyIdempotent

Use this when the user wants a word count, character count (with or without spaces), sentence or paragraph count, reading or speaking time, readability, or keyword density for text they provide, including essay counts without citations, quotes, headings, or the reference list. Pass the text exactly as written. Handles up to 100,000 characters and Japanese, Chinese, and Thai word splitting. Does not rewrite, shorten, translate, or grade the text, and does not read files or URLs.

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
textYesThe exact text to count, copied verbatim from the user without edits (up to 100,000 characters). Example: The quick brown fox jumps over the lazy dog.
languageNoOptional BCP 47 language code, e.g. ja. Improves word splitting for Japanese, Chinese, and Thai; readability scores are only given for English.
exclude_quotesNoLeave out passages inside double quotation marks ("...", curly quotes, guillemets). Example: false.
exclude_headingsNoLeave out headings: Markdown # lines and short title lines directly above a paragraph. Example: true.
exclude_citationsNoLeave out in-text citations: APA (Smith, 2020), (Lee et al., 2019, p. 12), MLA (Smith 23), page refs (p. 4), and numeric [3]. Example: true.
exclude_reference_listNoLeave out everything from a References, Works Cited, or Bibliography heading to the end. Example: true.

Output Schema

NameRequiredDescriptionDefault
kindYes
linesYes
wordsYes
lettersYes
optionsYes
privacyYes
excludedNo
keywordsYes
sentencesYes
charactersYes
paragraphsYes
readabilityYes
reading_timeYes
unique_wordsYes
speaking_timeYes
cjk_charactersNo
long_sentencesYes
original_wordsNo
avg_word_lengthYes
longest_sentenceYes
avg_sentence_wordsYes
characters_no_spacesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive/closed-world, so the safety profile is covered. The description adds genuinely new behavior: a 100,000-character ceiling, Thai/Japanese/Chinese word splitting, readability restricted to English, and the requirement to pass text verbatim. Return shape is left to the output schema, which is appropriate.

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 the trigger condition and dense with substance; every clause maps to a capability or a boundary. It runs long, but little is padding given the breadth of outputs supported.

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 present, the description need not explain return values, and it covers limits, language handling, and exclusion behavior well. Only minor gap is that it does not state what happens at the 100k limit (truncate vs. error).

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 coverage is 100%, so each parameter including the four exclude_* flags is already documented with examples. The description's phrase 'essay counts without citations, quotes, headings, or the reference list' echoes those flags without adding syntax or defaults beyond the schema, so the baseline 3 is right.

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) and enumerates the measurable outputs — words, characters with/without spaces, sentences, paragraphs, reading time, readability, keyword density. The closing exclusions ('does not rewrite, shorten, translate, or grade... does not read files or URLs') separate it from the sibling check_length_limits, which is about platform limits rather than producing counts.

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

Usage Guidelines5/5

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

Opens with an explicit trigger: 'Use this when the user wants...' followed by a concrete list of request types, including the essay-without-citations case. It also draws negative boundaries (no rewriting, translation, grading, file or URL reading) so the agent knows when to route elsewhere.

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