Skip to main content
Glama
icck

Toy MCP Server

by icck

count_letters

Count how many times a specific letter appears in any given word to analyze text patterns or verify character frequency.

Instructions

Count the number of times a letter appears in a word

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
wordYesThe word to count letters in
letterYesThe letter to count

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • server.py:12-15 (registration)
    Registration of the 'count_letters' tool using @mcp.tool decorator with name and description.
    @mcp.tool(
        name="count_letters",
        description="Count the number of times a letter appears in a word",
    )
  • server.py:16-20 (handler)
    The handler function for the 'count_letters' tool, defining input schema via Annotated Fields and delegating to the implementation.
    def count_letters(
        word: Annotated[str, Field(description="The word to count letters in")],
        letter: Annotated[str, Field(description="The letter to count")],
    ) -> int:
        return count_letters_impl(word, letter)
  • Helper function containing the core logic for counting occurrences of a letter in a word, case-insensitively.
    def count_letters_impl(
        word: Annotated[str, Field(description="The word to count letters in")],
        letter: Annotated[str, Field(description="The letter to count")],
    ) -> int:
        """Count the number of times a letter appears in a word."""
        return word.lower().count(letter.lower())
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It describes the basic function but lacks information about error handling, case sensitivity, performance characteristics, or what happens with invalid inputs. This is inadequate for a tool with no annotation coverage.

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?

The description is a single, clear sentence that directly states the tool's purpose with zero wasted words. It's appropriately sized and front-loaded, making it highly efficient.

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?

Given the tool's simplicity (2 parameters, 100% schema coverage, output schema exists), the description is reasonably complete for its purpose. The output schema handles return values, so the description doesn't need to explain them. However, it could benefit from more behavioral context given the lack of annotations.

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?

The schema description coverage is 100%, with both parameters clearly documented in the schema. The description adds no additional parameter semantics beyond what's already in the schema, so it meets the baseline of 3 for high schema coverage without adding value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs ('count') and resources ('number of times a letter appears in a word'), making it immediately understandable. However, it doesn't differentiate from the sibling tool 'generate_uuid7s' (which is unrelated), so it doesn't fully address sibling distinction.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives or in what context it's appropriate. It states what the tool does but offers no usage instructions, prerequisites, or 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/icck/toy'

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