Skip to main content
Glama
rvibek

UNHCR Population Data MCP Server

get_population_data

Retrieve UNHCR data on forcibly displaced populations including refugees, asylum seekers, and stateless persons by country of origin, asylum, and year.

Instructions

    Get forcibly displaced populations like refugees, asylum seekers, stateless persons data from UNHCR.

    Args:
        coo: Country of origin (ISO3 code) - Use for questions about refugees FROM a specific country
        coa: Country of asylum (ISO3 code) - Use for questions about refugees IN a specific country
        year: Year to filter by (defaults to 2025)
        coo_all: Set to True when breaking down results by ORIGIN country
        coa_all: Set to True when breaking down results by ASYLUM country

    Returns:
        Population data from UNHCR API
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cooNo
coaNo
yearNo
coo_allNo
coa_allNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The primary handler function for the get_population_data MCP tool. It is registered via the @server.tool() decorator and delegates to the UNHCRAPIClient.get_population helper method to fetch data from the UNHCR API.
    def get_population_data(
        coo: str | None = None,
        coa: str | None = None,
        year: str | int | None = None,
        coo_all: bool = False,
        coa_all: bool = False,
    ) -> dict[str, Any]:
        """
        Get forcibly displaced populations like refugees, asylum seekers, stateless persons data from UNHCR.
    
        Args:
            coo: Country of origin (ISO3 code) - Use for questions about refugees FROM a specific country
            coa: Country of asylum (ISO3 code) - Use for questions about refugees IN a specific country
            year: Year to filter by (defaults to 2025)
            coo_all: Set to True when breaking down results by ORIGIN country
            coa_all: Set to True when breaking down results by ASYLUM country
    
        Returns:
            Population data from UNHCR API
        """
        return api_client.get_population(
            coo=coo, coa=coa, year=year, coo_all=coo_all, coa_all=coa_all
        )
  • Supporting helper method in the UNHCRAPIClient class that performs the actual API fetch for population data by calling the generic _fetch method with the 'population' endpoint.
    def get_population(self, coo: Optional[str] = None, coa: Optional[str] = None, 
                      year: Optional[Union[str, int]] = None, coo_all: bool = False, 
                      coa_all: bool = False) -> dict[str, Any]:
        return self._fetch("population", coo=coo, coa=coa, year=year, coo_all=coo_all, coa_all=coa_all)
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses that data comes from 'UNHCR API' and describes the tool's purpose, but lacks details on behavioral traits like rate limits, authentication requirements, error handling, or whether this is a read-only operation. The description doesn't contradict annotations (none exist), but provides only basic 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.

Conciseness4/5

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

The description is appropriately sized and well-structured with clear sections (purpose, args, returns). Every sentence adds value, though the parameter explanations could be slightly more concise. The front-loaded purpose statement immediately clarifies the tool's function.

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 5 parameters with 0% schema coverage and no annotations, the description does an excellent job explaining parameter semantics. The presence of an output schema means the description doesn't need to detail return values. However, for a data retrieval tool with no annotations, additional context about data freshness, limitations, or API constraints would improve completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate fully. It provides detailed semantic explanations for all 5 parameters: coo ('Country of origin'), coa ('Country of asylum'), year ('Year to filter by'), coo_all ('breaking down results by ORIGIN country'), and coa_all ('breaking down results by ASYLUM country'). Each parameter's purpose and usage context is clearly explained beyond what the bare schema provides.

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 specific action ('Get forcibly displaced populations data') and resource ('from UNHCR'), explicitly listing the types of populations covered (refugees, asylum seekers, stateless persons). It distinguishes this tool from siblings like get_demographics_data or get_rsd_applications by focusing on population data rather than demographics or RSD processes.

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

Usage Guidelines4/5

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

The description provides clear context for when to use specific parameters (e.g., 'Use for questions about refugees FROM a specific country' for coo), which implicitly guides usage. However, it doesn't explicitly state when to use this tool versus sibling tools like get_demographics_data or provide explicit exclusions or alternatives.

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/rvibek/mcp_unhcr'

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