Skip to main content
Glama
mattjegan

eBird MCP Server

by mattjegan

get_nearby_species_observations

Find recent bird sightings for a specific species near any location using eBird data. Specify coordinates, species code, search radius, and time range to retrieve observation records.

Instructions

Get recent observations of a specific species near a location.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
latYesLatitude
lngYesLongitude
species_codeYeseBird species code
backNoNumber of days back to fetch
distNoSearch radius in kilometers
hotspotNoOnly fetch from hotspots
include_provisionalNoInclude unreviewed observations
max_resultsNoMaximum observations to return
spp_localeNoLanguage for common namesen

Implementation Reference

  • Handler function that constructs query parameters from inputs, calls the eBird API endpoint `/data/obs/geo/recent/{species_code}`, and formats the response as JSON text.
      async (args) => {
        const params: Record<string, string | number | boolean> = {
          lat: args.lat,
          lng: args.lng,
          back: args.back,
          dist: args.dist,
          hotspot: args.hotspot,
          includeProvisional: args.include_provisional,
          sppLocale: args.spp_locale,
        };
        if (args.max_results) params.maxResults = args.max_results;
    
        const result = await makeRequest(`/data/obs/geo/recent/${args.species_code}`, params);
        return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
      }
    );
  • Zod schema defining input parameters for the tool, including coordinates, species code, time window, distance, and filters.
    {
      lat: z.number().min(-90).max(90).describe("Latitude"),
      lng: z.number().min(-180).max(180).describe("Longitude"),
      species_code: z.string().describe("eBird species code"),
      back: z.number().min(1).max(30).default(14).describe("Number of days back to fetch"),
      dist: z.number().min(0).max(50).default(25).describe("Search radius in kilometers"),
      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"),
      spp_locale: z.string().default("en").describe("Language for common names"),
    },
  • src/index.ts:159-189 (registration)
    Tool registration call using McpServer.tool() method, specifying name, description, input schema, and handler function.
    server.tool(
      "get_nearby_species_observations",
      "Get recent observations of a specific species near a location.",
      {
        lat: z.number().min(-90).max(90).describe("Latitude"),
        lng: z.number().min(-180).max(180).describe("Longitude"),
        species_code: z.string().describe("eBird species code"),
        back: z.number().min(1).max(30).default(14).describe("Number of days back to fetch"),
        dist: z.number().min(0).max(50).default(25).describe("Search radius in kilometers"),
        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"),
        spp_locale: z.string().default("en").describe("Language for common names"),
      },
      async (args) => {
        const params: Record<string, string | number | boolean> = {
          lat: args.lat,
          lng: args.lng,
          back: args.back,
          dist: args.dist,
          hotspot: args.hotspot,
          includeProvisional: args.include_provisional,
          sppLocale: args.spp_locale,
        };
        if (args.max_results) params.maxResults = args.max_results;
    
        const result = await makeRequest(`/data/obs/geo/recent/${args.species_code}`, params);
        return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
      }
    );
  • Utility function used by all tools to make authenticated HTTP requests to the eBird API, handling query parameters 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 the full burden of behavioral disclosure. It mentions 'recent observations' but does not specify timeframes, data sources, rate limits, authentication needs, or return formats. For a tool with 9 parameters and no output schema, this is inadequate, though it hints at recency and location-based filtering. A score of 2 reflects partial but insufficient behavioral 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, clear sentence that efficiently conveys the core functionality without unnecessary details. It is front-loaded and wastes no words, making it highly concise and well-structured for quick comprehension.

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 (9 parameters, no annotations, no output schema), the description is incomplete. It lacks details on behavioral traits, usage context, and output expectations, leaving significant gaps for an AI agent. Without annotations or output schema, the description should provide more comprehensive guidance, but it does not, resulting in a low score.

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 description adds minimal semantic value beyond the input schema, which has 100% coverage. It implies parameters like location and species but does not explain their roles or interactions (e.g., how 'back' and 'dist' affect results). With high schema coverage, the baseline is 3, as the schema documents parameters adequately, and the description does not significantly 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 recent observations of a specific species near a location.' It specifies the verb ('get'), resource ('observations'), and scope ('recent,' 'specific species,' 'near a location'). However, it does not explicitly differentiate from sibling tools like 'get_nearby_observations' or 'get_nearest_species_observations,' which reduces the score from 5 to 4.

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. With many sibling tools (e.g., 'get_nearby_observations,' 'get_nearest_species_observations'), there is no indication of context, exclusions, or prerequisites. This lack of differentiation results in a score of 2, as it offers minimal usage direction.

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