Skip to main content
Glama
kshayk

AviBase MCP Server

by kshayk

get_random_birds

Retrieve random bird samples from the AviBase dataset for exploration and discovery purposes, with configurable count options.

Instructions

Get a random sample of birds for exploration and discovery.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
countNoNumber of random birds to return (default: 10, max: 50)

Implementation Reference

  • The main handler function for the 'get_random_birds' tool. It extracts the count parameter (default 10, max 50), calls the backend API at /random, and formats a markdown response listing random birds with their details.
      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!`,
            },
          ],
        };
      }
  • The tool schema definition including name, description, and inputSchema for 'get_random_birds' used 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/dispatch for 'get_random_birds' in the CallToolRequestHandler.
    case 'get_random_birds':
      return await this.handleGetRandomBirds(args);
  • mcp-server.js:68-280 (registration)
    The ListToolsRequestHandler where all tools including 'get_random_birds' are registered by returning the tools list.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: [
          {
            name: 'get_bird_stats',
            description: 'Get comprehensive statistics about the bird dataset including total records, species count, families, orders, and conservation categories.',
            inputSchema: {
              type: 'object',
              properties: {},
              required: [],
            },
          },
          {
            name: 'search_birds',
            description: 'Search for birds by scientific or common name with fuzzy matching support.',
            inputSchema: {
              type: 'object',
              properties: {
                query: {
                  type: 'string',
                  description: 'Search term (bird name to search for)',
                },
                exact: {
                  type: 'boolean',
                  description: 'Whether to use exact matching (default: false for fuzzy search)',
                  default: false,
                },
                limit: {
                  type: 'number',
                  description: 'Maximum number of results to return (default: 20)',
                  default: 20,
                },
              },
              required: ['query'],
            },
          },
          {
            name: 'get_birds_by_taxonomy',
            description: 'Get birds filtered by taxonomic classification (Order, Family, or taxonomic rank).',
            inputSchema: {
              type: 'object',
              properties: {
                level: {
                  type: 'string',
                  description: 'Taxonomic level to filter by',
                  enum: ['Order', 'Family', 'Taxon_rank'],
                },
                value: {
                  type: 'string',
                  description: 'Value to filter by (e.g., "Strigiformes" for owls, "Accipitridae" for hawks)',
                },
                limit: {
                  type: 'number',
                  description: 'Maximum number of results to return (default: 50)',
                  default: 50,
                },
              },
              required: ['level', 'value'],
            },
          },
          {
            name: 'get_conservation_status',
            description: 'Get birds by IUCN Red List conservation status (CR=Critically Endangered, EN=Endangered, VU=Vulnerable, EX=Extinct, etc.).',
            inputSchema: {
              type: 'object',
              properties: {
                category: {
                  type: 'string',
                  description: 'IUCN Red List category',
                  enum: ['CR', 'EN', 'VU', 'NT', 'LC', 'DD', 'EX', 'EW'],
                },
                limit: {
                  type: 'number',
                  description: 'Maximum number of results to return (default: 50)',
                  default: 50,
                },
              },
              required: ['category'],
            },
          },
          {
            name: 'get_birds_by_region',
            description: 'Find birds by geographic region or range (e.g., Madagascar, Australia, Africa, etc.).',
            inputSchema: {
              type: 'object',
              properties: {
                region: {
                  type: 'string',
                  description: 'Geographic region to search for in bird ranges',
                },
                limit: {
                  type: 'number',
                  description: 'Maximum number of results to return (default: 50)',
                  default: 50,
                },
              },
              required: ['region'],
            },
          },
          {
            name: 'get_extinct_species',
            description: 'Get all extinct or possibly extinct bird species.',
            inputSchema: {
              type: 'object',
              properties: {
                limit: {
                  type: 'number',
                  description: 'Maximum number of results to return (default: 100)',
                  default: 100,
                },
              },
              required: [],
            },
          },
          {
            name: 'get_birds_by_authority',
            description: 'Find birds described by a specific taxonomic authority (e.g., Linnaeus, Darwin, etc.).',
            inputSchema: {
              type: 'object',
              properties: {
                authority: {
                  type: 'string',
                  description: 'Name of the taxonomic authority',
                },
                limit: {
                  type: 'number',
                  description: 'Maximum number of results to return (default: 50)',
                  default: 50,
                },
              },
              required: ['authority'],
            },
          },
          {
            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: [],
            },
          },
          {
            name: 'get_bird_report',
            description: 'Get a detailed report for a specific bird species including related species and comprehensive information.',
            inputSchema: {
              type: 'object',
              properties: {
                scientific_name: {
                  type: 'string',
                  description: 'Scientific name of the bird species (e.g., "Aquila chrysaetos")',
                },
              },
              required: ['scientific_name'],
            },
          },
          {
            name: 'custom_bird_query',
            description: 'Perform complex queries with multiple filters for advanced bird data analysis.',
            inputSchema: {
              type: 'object',
              properties: {
                filters: {
                  type: 'object',
                  description: 'Object containing field-value pairs for filtering',
                  properties: {
                    Family: { type: 'string' },
                    Order: { type: 'string' },
                    IUCN_Red_List_Category: { 
                      type: 'array',
                      items: { type: 'string' }
                    },
                    Taxon_rank: { type: 'string' },
                  },
                },
                limit: {
                  type: 'number',
                  description: 'Maximum number of results to return (default: 50)',
                  default: 50,
                },
              },
              required: ['filters'],
            },
          },
          {
            name: 'execute_jsonata_query',
            description: 'Execute a raw JSONata query for advanced data analysis and transformation. JSONata is a powerful query language for JSON data.',
            inputSchema: {
              type: 'object',
              properties: {
                query: {
                  type: 'string',
                  description: 'JSONata query expression (e.g., "$count($[Taxon_rank = \\"species\\"])" to count species)',
                },
                limit: {
                  type: 'number',
                  description: 'Maximum number of results to return for array results (default: 50)',
                  default: 50,
                },
              },
              required: ['query'],
            },
          },
        ],
      };
    });
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool returns a 'random sample' but does not explain how randomness is implemented, whether results are reproducible, what data fields are included in the output, or any rate limits or authentication requirements. This leaves significant gaps in understanding the tool's behavior.

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 efficiently conveys the tool's purpose without unnecessary words. It is front-loaded with the core action ('Get a random sample of birds') and adds a brief rationale ('for exploration and discovery'), making it easy to understand quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete. It does not address key behavioral aspects like output format, randomness mechanism, or error handling. For a tool with no structured metadata, the description should provide more context to compensate, but it falls short, leaving the agent with insufficient information for reliable use.

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 input schema has 100% description coverage, with the 'count' parameter well-documented in the schema (including default and maximum values). The description does not add any parameter-specific information beyond what the schema provides, such as clarifying the meaning of 'random' or output details. With high schema coverage, the baseline score of 3 is appropriate.

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 a specific verb ('Get') and resource ('random sample of birds'), and mentions the goal ('for exploration and discovery'). However, it does not explicitly distinguish this tool from its siblings like 'get_birds_by_region' or 'search_birds', which might also involve retrieving birds but with different filtering criteria.

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. It mentions 'exploration and discovery' but does not specify scenarios where random sampling is preferred over structured queries like 'get_birds_by_region' or 'search_birds', nor does it mention any prerequisites or exclusions for usage.

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/kshayk/avibase-mcp'

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