Skip to main content
Glama
mattjegan

eBird MCP Server

by mattjegan

get_sub_regions

Retrieve hierarchical geographic subdivisions from the eBird database to navigate bird observation regions. Specify region type and parent code to get countries, states, or counties.

Instructions

Get sub-regions within a parent region. Examples: get_sub_regions('country', 'world') for all countries, get_sub_regions('subnational1', 'US') for US states.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
region_typeYesType of sub-regions
parent_region_codeYesParent region code, or 'world' for countries
fmtNoResponse formatjson

Implementation Reference

  • The handler function for the 'get_sub_regions' tool. It fetches sub-regions by making an API request to `/ref/region/list/${region_type}/${parent_region_code}` with optional fmt parameter and returns the result as JSON-formatted text content.
    async (args) => {
      const result = await makeRequest(`/ref/region/list/${args.region_type}/${args.parent_region_code}`, {
        fmt: args.fmt,
      });
      return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
  • Input schema for the 'get_sub_regions' tool using Zod validation: region_type (enum), parent_region_code (string), fmt (enum with default 'json').
    {
      region_type: z.enum(["country", "subnational1", "subnational2"]).describe("Type of sub-regions"),
      parent_region_code: z.string().describe("Parent region code, or 'world' for countries"),
      fmt: z.enum(["json", "csv"]).default("json").describe("Response format"),
    },
  • src/index.ts:548-562 (registration)
    Registration of the 'get_sub_regions' tool using server.tool(), including name, description, input schema, and inline handler function.
    server.tool(
      "get_sub_regions",
      "Get sub-regions within a parent region. Examples: get_sub_regions('country', 'world') for all countries, get_sub_regions('subnational1', 'US') for US states.",
      {
        region_type: z.enum(["country", "subnational1", "subnational2"]).describe("Type of sub-regions"),
        parent_region_code: z.string().describe("Parent region code, or 'world' for countries"),
        fmt: z.enum(["json", "csv"]).default("json").describe("Response format"),
      },
      async (args) => {
        const result = await makeRequest(`/ref/region/list/${args.region_type}/${args.parent_region_code}`, {
          fmt: args.fmt,
        });
        return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
      }
    );
Behavior3/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 describes the tool's function and provides examples, but lacks details on permissions, rate limits, pagination, or error handling. For a read-only tool (implied by 'Get'), this is a moderate gap, but the examples add some practical context beyond basic functionality.

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 front-loaded with the core purpose in the first sentence, followed by two concise examples that illustrate usage without redundancy. Every sentence earns its place by clarifying scope and application, making it efficient and well-structured for an AI agent.

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

Completeness4/5

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

Given the tool's moderate complexity (3 parameters, no output schema, no annotations), the description is reasonably complete. It covers purpose, usage guidelines, and parameter semantics through examples, but lacks details on output format or behavioral traits like error handling. With no output schema, it could benefit from mentioning the structure of returned data, but the examples imply a list of regions.

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_type, parent_region_code, fmt) with enums and defaults. The description adds value by explaining the semantics of parent_region_code with 'world' for countries and providing usage examples, but doesn't introduce new parameter details beyond what the schema provides. Baseline 3 is appropriate given high schema coverage.

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

Purpose5/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 'sub-regions within a parent region', making the purpose specific. It distinguishes from siblings like get_region_info or get_regional_statistics by focusing on hierarchical relationships rather than metadata or statistics. The examples reinforce this distinction by showing concrete use cases.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to use this tool through examples: get_sub_regions('country', 'world') for all countries and get_sub_regions('subnational1', 'US') for US states. This clarifies the tool's scope and distinguishes it from alternatives like get_region_info (which might return metadata about a single region) or get_adjacent_regions (which might return neighboring regions rather than hierarchical children).

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