get_random_birds
Retrieve a random sample of birds from the AviBase dataset for exploration and discovery, with customizable count up to 50.
Instructions
Get a random sample of birds for exploration and discovery.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | No | Number of random birds to return (default: 10, max: 50) |
Implementation Reference
- mcp-server.js:542-565 (handler)The handler function that executes the get_random_birds tool. It calls the /random API endpoint with a count parameter (capped at 50), fetches the data, and formats a markdown response listing random birds with their scientific name, common name, family, order, conservation status, and range.async handleGetRandomBirds(args) { const { count = 10 } = args; const endpoint = `/random?count=${Math.min(count, 50)}`; const response = await this.makeAPIRequest(endpoint); return { content: [ { type: 'text', text: `# Random Bird Discovery 🎲 **${response.data.length}** randomly selected birds for exploration: ${response.data.map((bird, i) => `${i + 1}. **${bird.Scientific_name}** - Common name: ${bird.English_name_AviList || 'No common name'} - Family: ${bird.Family} (${bird.Order}) - Conservation: ${bird.IUCN_Red_List_Category || 'Not assessed'} - Range: ${bird.Range ? bird.Range.substring(0, 100) + '...' : 'No range data'}`).join('\n\n')} These random selections showcase the incredible diversity of avian species in the database!`, }, ], }; }
- mcp-server.js:201-216 (schema)The tool schema definition including name, description, and input schema for 'get_random_birds' registered in the ListTools response.{ name: 'get_random_birds', description: 'Get a random sample of birds for exploration and discovery.', inputSchema: { type: 'object', properties: { count: { type: 'number', description: 'Number of random birds to return (default: 10, max: 50)', default: 10, maximum: 50, }, }, required: [], }, },
- mcp-server.js:309-310 (registration)The switch case registration that dispatches calls to the get_random_birds tool to its handler function.case 'get_random_birds': return await this.handleGetRandomBirds(args);