Skip to main content
Glama
Aaryan-Kapoor

MCP Character Tools

check_tricky_word

Identify words commonly miscounted in text analysis by checking for tricky spelling patterns that cause character counting errors.

Instructions

Look up a specific word to see if it's a commonly miscounted word.

Args:

  • word (string): The word to check

Returns: Information about common mistakes if it's a tricky word, or empty if not.

Example: check_tricky_word("strawberry") → explains the 3 r's and common mistake of counting 2

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
wordYesThe word to check

Implementation Reference

  • The core handler function for the 'check_tricky_word' tool. It retrieves matching tricky words using getTrickyWordByName, checks if any found, formats explanation of count, positions, common mistake, and explanation if tricky, or a not-found message otherwise, and returns as text content.
    async (params) => {
      const entries = getTrickyWordByName(params.word);
      const is_tricky = entries.length > 0;
    
      let text: string;
      if (is_tricky) {
        text = entries
          .map(e => `"${e.word}" has ${e.count} '${e.letter}'(s) at positions [${e.positions.join(', ')}].\nCommon mistake: counting ${e.common_mistake} instead.\n${e.explanation}`)
          .join('\n\n');
      } else {
        text = `"${params.word}" is not in the tricky words database. Use count_letter to analyze it.`;
      }
    
      return {
        content: [{ type: "text" as const, text }],
      };
    }
  • Input schema using Zod: requires a 'word' string parameter (min length 1). Includes annotations indicating read-only, non-destructive, idempotent tool.
    inputSchema: z.object({
      word: z.string().min(1).describe("The word to check"),
    }).strict(),
    annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
  • src/index.ts:515-549 (registration)
    The server.registerTool call that registers the 'check_tricky_word' tool, providing name, metadata/schema, and handler function.
    server.registerTool(
      "check_tricky_word",
      {
        title: "Check Tricky Word",
        description: `Look up a specific word to see if it's a commonly miscounted word.
    
    Args:
      - word (string): The word to check
    
    Returns: Information about common mistakes if it's a tricky word, or empty if not.
    
    Example: check_tricky_word("strawberry") → explains the 3 r's and common mistake of counting 2`,
        inputSchema: z.object({
          word: z.string().min(1).describe("The word to check"),
        }).strict(),
        annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
      },
      async (params) => {
        const entries = getTrickyWordByName(params.word);
        const is_tricky = entries.length > 0;
    
        let text: string;
        if (is_tricky) {
          text = entries
            .map(e => `"${e.word}" has ${e.count} '${e.letter}'(s) at positions [${e.positions.join(', ')}].\nCommon mistake: counting ${e.common_mistake} instead.\n${e.explanation}`)
            .join('\n\n');
        } else {
          text = `"${params.word}" is not in the tricky words database. Use count_letter to analyze it.`;
        }
    
        return {
          content: [{ type: "text" as const, text }],
        };
      }
    );
  • Helper function exported from tricky-words.ts that performs case-insensitive lookup in the TRICKY_WORDS database array to find matching TrickyWord entries by word name.
    export function getTrickyWordByName(word: string): TrickyWord[] {
      return TRICKY_WORDS.filter(w => w.word.toLowerCase() === word.toLowerCase());
    }

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/Aaryan-Kapoor/mcp-character-tools'

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