Skip to main content
Glama
mattjegan

eBird MCP Server

by mattjegan

get_hotspots_in_region

Find birding hotspots within a specific region using eBird data. Filter results by recent visitor activity and choose output format.

Instructions

Get birding hotspots in a region.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
region_codeYesCountry, subnational1, or subnational2 code
backNoOnly hotspots visited in last N days
fmtNoResponse formatjson

Implementation Reference

  • src/index.ts:399-414 (registration)
    Registration of the 'get_hotspots_in_region' tool using server.tool(), including name, description, input schema with Zod validation, and the handler function.
    server.tool(
      "get_hotspots_in_region",
      "Get birding hotspots in a region.",
      {
        region_code: z.string().describe("Country, subnational1, or subnational2 code"),
        back: z.number().min(1).max(30).optional().describe("Only hotspots visited in last N days"),
        fmt: z.enum(["json", "csv"]).default("json").describe("Response format"),
      },
      async (args) => {
        const params: Record<string, string | number | boolean> = { fmt: args.fmt };
        if (args.back) params.back = args.back;
    
        const result = await makeRequest(`/ref/hotspot/${args.region_code}`, params);
        return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
      }
    );
  • Handler function that prepares query parameters (fmt and optional back) and calls the shared makeRequest helper to fetch hotspot data from the eBird API endpoint `/ref/hotspot/${region_code}`, returning the JSON-stringified result wrapped in MCP content format.
    async (args) => {
      const params: Record<string, string | number | boolean> = { fmt: args.fmt };
      if (args.back) params.back = args.back;
    
      const result = await makeRequest(`/ref/hotspot/${args.region_code}`, params);
      return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
    }
  • Input schema defined using Zod for parameter validation: region_code (required string), back (optional number 1-30), fmt (enum json/csv, default json).
    {
      region_code: z.string().describe("Country, subnational1, or subnational2 code"),
      back: z.number().min(1).max(30).optional().describe("Only hotspots visited in last N days"),
      fmt: z.enum(["json", "csv"]).default("json").describe("Response format"),
    },
  • Shared helper function used by all tools to make authenticated HTTP requests to the eBird API, handling URL params, fetch, error checking, and JSON parsing.
    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 states what the tool does but lacks critical details: it doesn't mention whether this is a read-only operation, potential rate limits, authentication needs, or what the output looks like (e.g., list format, pagination). For a tool with no annotation coverage, this is a significant gap in transparency.

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 with zero waste—it directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, making it easy for an agent 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 the complexity (3 parameters, no annotations, no output schema), the description is incomplete. It doesn't explain return values, behavioral traits like safety or performance, or how it differs from siblings. For a tool in this context, more detail is needed to guide the agent effectively beyond the basic purpose.

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 already documents all parameters (region_code, back, fmt) thoroughly. The description adds no additional meaning beyond implying a regional scope, which is redundant with the schema. This meets the baseline of 3, as the schema does the heavy lifting for parameter semantics.

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 verb ('Get') and resource ('birding hotspots in a region'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'get_nearby_hotspots' or 'get_hotspot_info', which offer similar hotspot-related functionality, leaving some ambiguity about when to choose this specific tool.

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 siblings like 'get_nearby_hotspots' (for proximity-based queries) and 'get_hotspot_info' (for detailed info on a single hotspot), the lack of context leaves the agent to infer usage based on tool names alone, which is insufficient for reliable selection.

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