Skip to main content
Glama

word_count

Count words, lines, and characters in a text string. Returns pure, side-effect-free text metrics.

Instructions

Count words, lines, and characters in a string.

Pure computation - no side effects at all.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden and does disclose the key behavioral trait: 'Pure computation - no side effects at all,' which tells the agent this is a safe, non-mutating operation with no auth or state implications. It stops short of noting edge cases (empty string, how newlines define a 'line'), but the central safety property is covered.

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?

Two short sentences, zero filler, with the core purpose front-loaded and the safety note following. Nothing could be cut without losing information.

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?

An output schema exists, so return values need no explanation, and for a single-parameter pure function the definition is nearly complete. The only residual gap is that edge-case counting semantics (newline handling, whitespace) are left undefined.

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?

Only one parameter (text) and schema description coverage is 0%, so the schema adds nothing. The description's phrase 'in a string' at least confirms the input type and nature, but it gives no detail on encoding, multi-line handling, or how whitespace affects the word count.

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 the exact resources measured (words, lines, characters) against a clearly named input (a string). This is unambiguous and easily distinguished from the sibling tools, which all operate on files or directories rather than in-memory strings.

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

Usage Guidelines3/5

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

Usage is only implied: the tool's utility is self-evident for a pure string computation, but the description never states when to reach for it versus, say, reading a file and counting externally. No exclusions or alternatives are offered, though for a trivial utility the cost of that omission is low.

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