get_tricky_words
Identify words with double letters or repeated patterns that cause counting errors in language models, providing correct character counts and explanations.
Instructions
Get a list of words that are commonly miscounted by LLMs.
These are words with double letters, repeated patterns, or other features that cause counting errors.
Returns: List of tricky words with correct counts and explanations.
Example: Returns "strawberry" with explanation that it has 3 r's, not 2.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/resources/tricky-words.ts:186-198 (handler)The core handler function that categorizes the tricky words data into double_letters and triple_or_more, returning structured output.export function getTrickyWords(): TrickyWordsOutput { const double_letters = TRICKY_WORDS.filter(w => w.count === 2); const triple_or_more = TRICKY_WORDS.filter(w => w.count >= 3); return { total_words: TRICKY_WORDS.length, words: TRICKY_WORDS, categories: { double_letters, triple_or_more, }, }; }
- Output type definition for the getTrickyWords tool.export interface TrickyWordsOutput { total_words: number; words: TrickyWord[]; categories: { double_letters: TrickyWord[]; triple_or_more: TrickyWord[]; }; }
- src/index.ts:489-513 (registration)MCP tool registration for 'get_tricky_words', including schema (no inputs), description, and wrapper handler that formats and returns the result.server.registerTool( "get_tricky_words", { title: "Get Tricky Words", description: `Get a list of words that are commonly miscounted by LLMs. These are words with double letters, repeated patterns, or other features that cause counting errors. Returns: List of tricky words with correct counts and explanations. Example: Returns "strawberry" with explanation that it has 3 r's, not 2.`, inputSchema: z.object({}).strict(), annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false }, }, async () => { const result = getTrickyWords(); const summary = result.words .slice(0, 10) .map(w => `"${w.word}" '${w.letter}': ${w.count} (often miscounted as ${w.common_mistake})`) .join('\n'); return { content: [{ type: "text" as const, text: `${result.total_words} tricky words in database.\n\nExamples:\n${summary}\n\n...and ${result.total_words - 10} more.` }], }; } );
- src/resources/tricky-words.ts:5-12 (helper)Data structure for individual tricky words used in the tool.export interface TrickyWord { word: string; letter: string; count: number; positions: number[]; common_mistake: number; explanation: string; }
- src/resources/tricky-words.ts:14-175 (helper)The data array of tricky words with predefined counts, positions, and explanations.export const TRICKY_WORDS: TrickyWord[] = [ { word: "strawberry", letter: "r", count: 3, positions: [2, 7, 8], common_mistake: 2, explanation: "The 'r' appears three times: st[r]awbe[r][r]y. LLMs often miss the double 'r' at the end.", }, { word: "raspberry", letter: "r", count: 3, positions: [0, 6, 7], common_mistake: 2, explanation: "Three 'r's: [r]aspbe[r][r]y. The double 'r' near the end is often missed.", }, { word: "occurrence", letter: "r", count: 2, positions: [4, 5], common_mistake: 1, explanation: "Two consecutive 'r's: occu[r][r]ence. Easy to count as one.", }, { word: "occurrence", letter: "c", count: 3, positions: [1, 2, 8], common_mistake: 2, explanation: "Three 'c's: o[c][c]urren[c]e. The double 'c' at the start plus one later.", }, { word: "necessary", letter: "s", count: 2, positions: [4, 5], common_mistake: 1, explanation: "Two consecutive 's's: nece[s][s]ary.", }, { word: "accommodation", letter: "m", count: 2, positions: [4, 5], common_mistake: 1, explanation: "Two 'm's together: acco[m][m]odation.", }, { word: "mississippi", letter: "s", count: 4, positions: [2, 3, 5, 6], common_mistake: 3, explanation: "Four 's's in pairs: mi[s][s]i[s][s]ippi.", }, { word: "mississippi", letter: "i", count: 4, positions: [1, 4, 7, 10], common_mistake: 3, explanation: "Four 'i's spread throughout: m[i]ss[i]ss[i]pp[i].", }, { word: "mississippi", letter: "p", count: 2, positions: [8, 9], common_mistake: 1, explanation: "Two 'p's together: mississi[p][p]i.", }, { word: "entrepreneurship", letter: "r", count: 3, positions: [3, 6, 11], common_mistake: 2, explanation: "Three 'r's: ent[r]ep[r]eneu[r]ship. Spread across a long word.", }, { word: "programming", letter: "r", count: 2, positions: [1, 4], common_mistake: 1, explanation: "Two 'r's: p[r]og[r]amming.", }, { word: "programming", letter: "m", count: 2, positions: [6, 7], common_mistake: 1, explanation: "Two 'm's together: program[m][m]ing.", }, { word: "banana", letter: "a", count: 3, positions: [1, 3, 5], common_mistake: 2, explanation: "Three 'a's: b[a]n[a]n[a]. The repeating pattern can confuse.", }, { word: "assessment", letter: "s", count: 4, positions: [1, 2, 4, 5], common_mistake: 3, explanation: "Four 's's in two pairs: a[s][s]e[s][s]ment.", }, { word: "committee", letter: "m", count: 2, positions: [2, 3], common_mistake: 1, explanation: "Two 'm's: co[m][m]ittee.", }, { word: "committee", letter: "t", count: 2, positions: [5, 6], common_mistake: 1, explanation: "Two 't's: commi[t][t]ee.", }, { word: "committee", letter: "e", count: 2, positions: [7, 8], common_mistake: 1, explanation: "Two 'e's at the end: committ[e][e].", }, { word: "bookkeeper", letter: "o", count: 2, positions: [1, 2], common_mistake: 1, explanation: "Two 'o's: b[o][o]kkeeper.", }, { word: "bookkeeper", letter: "k", count: 2, positions: [3, 4], common_mistake: 1, explanation: "Two 'k's: boo[k][k]eeper.", }, { word: "bookkeeper", letter: "e", count: 3, positions: [5, 6, 8], common_mistake: 2, explanation: "Three 'e's: bookk[e][e]p[e]r.", }, ];