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

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)

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