Skip to main content
Glama
JeremyLakeyJr

Friday MCP Server

word_count

Count characters, words, and lines in a block of text to analyze text length and structure.

Instructions

Count characters, words, and lines in a block of text.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYes

Implementation Reference

  • The actual handler function for the 'word_count' tool. It counts characters, words, and lines in the input text.
    def word_count(text: str) -> dict:
        """Count characters, words, and lines in a block of text."""
        return {
            "characters": len(text),
            "words": len(text.split()),
            "lines": len(text.splitlines()),
        }
  • The 'register' function that registers the word_count tool via the @mcp.tool() decorator.
    def register(mcp) -> None:
  • The function signature with type hints: word_count(text: str) -> dict — serves as the schema definition for input (a string) and output (a dict).
    def word_count(text: str) -> dict:
  • The registration call site where utils.register(mcp) is invoked to register the word_count tool.
    def register_all_tools(mcp, *, config, skill_store) -> None:
        system.register(mcp, config=config)
        utils.register(mcp)
        web.register(mcp, config=config)
        workspace.register(mcp, config=config)
        skills.register(mcp, skill_store=skill_store)
Behavior3/5

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

No annotations provided. Description is straightforward but doesn't disclose edge cases (empty string, word definitions, line separators). Adequate but not rich.

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?

Extremely concise, one sentence with no waste. Every word earns its place.

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?

For a simple tool, description covers primary purpose. Lacks return value format but no output schema requires compensation. Minor gap.

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?

Single parameter 'text' is implied as the block to count, but description doesn't add constraints or format details beyond schema. Schema coverage 0%.

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?

Description clearly states the tool counts characters, words, and lines in text. Distinctively different from sibling tools like fetch_url, format_json, etc.

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?

No explicit guidance on when to use or alternatives. Usage is implied for text measurement, but lacks exclusions.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/JeremyLakeyJr/mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server