Skip to main content
Glama
mattjegan

eBird MCP Server

by mattjegan

get_historic_observations

Retrieve bird observations from a specific historical date using region code, date parameters, and filters for taxonomic categories or hotspot locations.

Instructions

Get observations from a specific date in history.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
region_codeYesCountry, subnational1, subnational2, or location code
yearYesYear
monthYesMonth
dayYesDay of month
catNoTaxonomic category filter
detailNoLevel of detailsimple
hotspotNoOnly fetch from hotspots
include_provisionalNoInclude unreviewed observations
max_resultsNoMaximum observations to return
rankNo'mrec' for latest, 'create' for first addedmrec
spp_localeNoLanguage for common namesen

Implementation Reference

  • The handler function that executes the logic for the get_historic_observations tool. It builds query parameters and makes an API request to eBird's historic observations endpoint.
    async (args) => {
      const params: Record<string, string | number | boolean> = {
        detail: args.detail,
        hotspot: args.hotspot,
        includeProvisional: args.include_provisional,
        rank: args.rank,
        sppLocale: args.spp_locale,
      };
      if (args.cat) params.cat = args.cat;
      if (args.max_results) params.maxResults = args.max_results;
    
      const result = await makeRequest(`/data/obs/${args.region_code}/historic/${args.year}/${args.month}/${args.day}`, params);
      return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
    }
  • Zod schema defining the input parameters and validation for the get_historic_observations tool.
      region_code: z.string().describe("Country, subnational1, subnational2, or location code"),
      year: z.number().min(1800).describe("Year"),
      month: z.number().min(1).max(12).describe("Month"),
      day: z.number().min(1).max(31).describe("Day of month"),
      cat: z.string().optional().describe("Taxonomic category filter"),
      detail: z.enum(["simple", "full"]).default("simple").describe("Level of detail"),
      hotspot: z.boolean().default(false).describe("Only fetch from hotspots"),
      include_provisional: z.boolean().default(false).describe("Include unreviewed observations"),
      max_results: z.number().min(1).max(10000).optional().describe("Maximum observations to return"),
      rank: z.enum(["mrec", "create"]).default("mrec").describe("'mrec' for latest, 'create' for first added"),
      spp_locale: z.string().default("en").describe("Language for common names"),
    },
  • src/index.ts:251-281 (registration)
    Registration of the get_historic_observations tool on the MCP server using server.tool(), including name, description, schema, and handler function.
    server.tool(
      "get_historic_observations",
      "Get observations from a specific date in history.",
      {
        region_code: z.string().describe("Country, subnational1, subnational2, or location code"),
        year: z.number().min(1800).describe("Year"),
        month: z.number().min(1).max(12).describe("Month"),
        day: z.number().min(1).max(31).describe("Day of month"),
        cat: z.string().optional().describe("Taxonomic category filter"),
        detail: z.enum(["simple", "full"]).default("simple").describe("Level of detail"),
        hotspot: z.boolean().default(false).describe("Only fetch from hotspots"),
        include_provisional: z.boolean().default(false).describe("Include unreviewed observations"),
        max_results: z.number().min(1).max(10000).optional().describe("Maximum observations to return"),
        rank: z.enum(["mrec", "create"]).default("mrec").describe("'mrec' for latest, 'create' for first added"),
        spp_locale: z.string().default("en").describe("Language for common names"),
      },
      async (args) => {
        const params: Record<string, string | number | boolean> = {
          detail: args.detail,
          hotspot: args.hotspot,
          includeProvisional: args.include_provisional,
          rank: args.rank,
          sppLocale: args.spp_locale,
        };
        if (args.cat) params.cat = args.cat;
        if (args.max_results) params.maxResults = args.max_results;
    
        const result = await makeRequest(`/data/obs/${args.region_code}/historic/${args.year}/${args.month}/${args.day}`, params);
        return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
      }
    );
  • Shared helper function used by the tool to make authenticated requests to the eBird API.
    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 the full burden. It mentions 'Get observations' but doesn't disclose behavioral traits such as whether this is a read-only operation, potential rate limits, authentication needs, or what the output format looks like (since there's no output schema). The description is minimal and lacks critical operational context for a tool with 11 parameters.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence: 'Get observations from a specific date in history.' It's front-loaded with the core action and resource, with zero wasted words. However, it's arguably too concise given the tool's complexity (11 parameters), leaving out necessary context that could be added in another sentence.

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 tool's complexity (11 parameters, no annotations, no output schema), the description is incomplete. It doesn't explain what 'observations' entail (e.g., biological data), how results are returned, or any limitations. With rich schema but no other structured fields, the description should provide more context to guide effective use, but it falls short.

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 schema description coverage is 100%, meaning all parameters are documented in the schema itself. The description adds no additional meaning beyond implying date-based filtering ('from a specific date'), which is already covered by the required year, month, and day parameters in the schema. With high schema coverage, the baseline score of 3 is appropriate as the description doesn't compensate but doesn't detract either.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get observations from a specific date in history' clearly states the verb ('Get') and resource ('observations'), but it's vague about what type of observations (e.g., bird sightings, weather data) and doesn't distinguish from siblings like 'get_recent_observations' or 'get_nearby_observations' that also retrieve observations. The purpose is understandable but lacks specificity and differentiation.

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?

No guidance is provided on when to use this tool versus alternatives. With many sibling tools for observations (e.g., 'get_recent_observations', 'get_nearby_observations'), the description doesn't specify that this is for historical data by date, nor does it mention prerequisites or exclusions. Usage is implied by the name but not explicitly stated.

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