Skip to main content
Glama
Traves-Theberge

Word of the Day MCP Server

get_random_word

Generate a random word with definition to expand vocabulary. Choose difficulty level (easy, medium, hard) for customized learning.

Instructions

Get a random word with its definition for word of the day

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
difficultyNoDifficulty level of the random wordmedium

Implementation Reference

  • The core handler function for the 'get_random_word' tool. It validates input args using the schema, selects a random word from difficulty-specific lists, and delegates to getWordDefinition for the response.
    private async getRandomWord(args: unknown) { const { difficulty = 'medium' } = GetRandomWordArgsSchema.parse(args); // List of curated words by difficulty level const wordLists = { easy: [ 'happy', 'house', 'water', 'light', 'music', 'friend', 'smile', 'peace', 'dream', 'heart', 'love', 'hope', 'time', 'life', 'world', 'nature' ], medium: [ 'serendipity', 'eloquent', 'resilient', 'magnificent', 'innovative', 'perspective', 'authentic', 'curiosity', 'adventure', 'harmony', 'wisdom', 'courage', 'gratitude', 'compassion', 'creativity', 'balance' ], hard: [ 'ephemeral', 'ubiquitous', 'perspicacious', 'surreptitious', 'magnanimous', 'obfuscate', 'ameliorate', 'propensity', 'vicissitude', 'perspicuity', 'sesquipedalian', 'grandiloquent', 'pusillanimous', 'truculent', 'recalcitrant' ] }; const words = wordLists[difficulty]; const randomWord = words[Math.floor(Math.random() * words.length)]; // Get the definition for the random word return await this.getWordDefinition({ word: randomWord, language: 'en' }); }
  • Zod schema for validating input arguments to the get_random_word tool, defining the optional 'difficulty' parameter.
    const GetRandomWordArgsSchema = z.object({ difficulty: z.enum(['easy', 'medium', 'hard']).default('medium').optional(), });
  • src/index.ts:91-106 (registration)
    Registration of the 'get_random_word' tool in the ListToolsRequestHandler, including metadata like name, description, and input schema.
    { name: 'get_random_word', description: 'Get a random word with its definition for word of the day', inputSchema: { type: 'object', properties: { difficulty: { type: 'string', enum: ['easy', 'medium', 'hard'], description: 'Difficulty level of the random word', default: 'medium', }, }, required: [], }, },
  • src/index.ts:119-120 (registration)
    Dispatch case in the CallToolRequestHandler switch statement that routes calls to the getRandomWord handler.
    case 'get_random_word': return await this.getRandomWord(args);

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/Traves-Theberge/Word_of_the_day'

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