Skip to main content
Glama

word_count

Count characters, words, and lines in text and return the three totals. Use for exact counts, not estimates; it does not tokenize or detect language.

Instructions

Count the characters, words and lines of a text and return the three counts as an object. Pure and stateless: the text is not stored or sent anywhere; no auth beyond the group's key. Words are whitespace-separated runs; lines are newline-separated (a trailing newline does not add a line); characters are Unicode code points including whitespace. Use it when a model needs an exact count rather than an estimate; it does not tokenise or detect language.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesthe text to count; may be empty, which yields zeros

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
linesYesnewline-separated lines; 0 for an empty text
wordsYeswhitespace-separated runs
charactersYesUnicode code points, whitespace included

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.7.1

TDQS

A4.7/5.0
Behavior5/5

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

No annotations are provided, so the description carries the full behavioral burden, and it delivers: 'Pure and stateless: the text is not stored or sent anywhere; no auth beyond the group's key.' It also pins down exact counting semantics (whitespace-separated words, newline-separated lines without a trailing-newline artifact, Unicode code points including whitespace), which is unusually complete for a no-annotation tool.

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?

Four sentences, front-loaded with what it counts and what it returns, then safety, then precise definitions. Every sentence contributes something an agent cannot get from the schema, with no filler.

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?

An output schema exists, so return-value documentation is unnecessary, yet the description still names the object shape. For a stateless one-parameter utility it covers purpose, selection, safety/auth, and edge-case semantics, leaving nothing an agent needs before calling it.

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 single parameter is already documented, including the empty-string case. The description's word/line/character rules govern how the result is computed rather than adding new meaning to the `text` parameter, so the baseline of 3 for high schema coverage is the right level.

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 precise verb and resource ('Count the characters, words and lines of a text') plus the exact return shape ('return the three counts as an object'). It is trivially distinguishable from the unrelated siblings demo_calculator_tool and unit_convert, and no other tool in the set could be confused with it.

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?

Explicitly gives the selection condition ('Use it when a model needs an exact count rather than an estimate') and the when-not cases ('it does not tokenise or detect language'). An agent knows both when to reach for this tool and which related tasks it must not use it for, without any inference.

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

Deploy Server

Other Tools