Skip to main content
Glama
mattjegan

eBird MCP Server

by mattjegan

get_regional_statistics

Retrieve bird observation statistics for a specific region and date, including checklist counts, species counts, and contributor numbers from eBird data.

Instructions

Get statistics for a region on a specific date (checklist count, species count, contributor count).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
region_codeYesCountry, subnational1, subnational2, or location code
yearYesYear
monthYesMonth
dayYesDay of month

Implementation Reference

  • Handler function that makes an API request to eBird's /product/stats endpoint with region and date parameters, then returns the JSON response as text content.
    async (args) => {
      const result = await makeRequest(`/product/stats/${args.region_code}/${args.year}/${args.month}/${args.day}`);
      return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
    }
  • Zod schema defining input parameters: region_code (string), year (number), month (number 1-12), day (number 1-31).
    {
      region_code: z.string().describe("Country, subnational1, subnational2, or location code"),
      year: z.number().describe("Year"),
      month: z.number().min(1).max(12).describe("Month"),
      day: z.number().min(1).max(31).describe("Day of month"),
    },
  • src/index.ts:340-353 (registration)
    MCP server tool registration for 'get_regional_statistics', including name, description, input schema, and inline handler function.
    server.tool(
      "get_regional_statistics",
      "Get statistics for a region on a specific date (checklist count, species count, contributor count).",
      {
        region_code: z.string().describe("Country, subnational1, subnational2, or location code"),
        year: z.number().describe("Year"),
        month: z.number().min(1).max(12).describe("Month"),
        day: z.number().min(1).max(31).describe("Day of month"),
      },
      async (args) => {
        const result = await makeRequest(`/product/stats/${args.region_code}/${args.year}/${args.month}/${args.day}`);
        return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
      }
    );
  • Shared helper function used by the tool (and others) to make authenticated requests to the eBird API, handling URL params and error checking.
    async function makeRequest(endpoint: string, params: Record<string, string | number | boolean> = {}): Promise<unknown> {
      const url = new URL(`${BASE_URL}${endpoint}`);
      Object.entries(params).forEach(([key, value]) => {
        if (value !== undefined && value !== null) {
          url.searchParams.append(key, String(value));
        }
      });
    
      const response = await fetch(url.toString(), {
        headers: { "X-eBirdApiToken": API_KEY! },
      });
    
      if (!response.ok) {
        throw new Error(`eBird API error: ${response.status} ${response.statusText}`);
      }
    
      return response.json();
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the tool retrieves statistics but doesn't disclose behavioral traits such as whether it's a read-only operation, potential rate limits, authentication requirements, or what happens with invalid dates/regions. The description is minimal and lacks necessary operational context.

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, efficient sentence that front-loads the core purpose and includes specific metric examples. Every word earns its place with zero wasted text, making it easy to parse 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 no annotations and no output schema, the description is incomplete for a tool with four required parameters. It doesn't explain what the statistics output looks like, how they're aggregated, or any error conditions. For a data retrieval tool, this leaves significant gaps in understanding its behavior and results.

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?

Schema description coverage is 100%, so the schema fully documents all four parameters. The description adds no additional parameter semantics beyond implying that 'region_code' and date parameters are used to fetch statistics. This meets the baseline for high schema coverage but doesn't enhance understanding.

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: 'Get statistics for a region on a specific date' with specific metrics (checklist count, species count, contributor count). It distinguishes from siblings by focusing on aggregated statistics rather than raw observations or region metadata, though it doesn't explicitly name alternatives.

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 like 'get_region_info' (which might provide metadata) or 'get_checklists_on_date' (which might provide raw data). It mentions what the tool does but offers no context about appropriate use cases or exclusions.

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/mattjegan/ebird-mcp'

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