Skip to main content
Glama
rvibek

UNHCR Population Data MCP Server

get_rsd_applications

Retrieve UNHCR refugee status determination application data by filtering country of origin, country of asylum, and year to analyze asylum trends.

Instructions

    Get RSD application data from UNHCR.

    Args:
        coo: Country of origin filter (ISO3 code, comma-separated for multiple)
        coa: Country of asylum filter (ISO3 code, comma-separated for multiple)
        year: Year filter (comma-separated for multiple years) - defaults to 2025
        coo_all: Set to True when analyzing the ORIGIN COUNTRIES of asylum seekers
        coa_all: Set to True when analyzing the ASYLUM COUNTRIES where applications were filed

    Returns:
        RSD application 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

  • Primary handler and registration for the get_rsd_applications tool via @server.tool() decorator. Proxies to UNHCRAPIClient.get_asylum_applications.
    @server.tool()
    def get_rsd_applications(
        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 RSD application data from UNHCR.
    
        Args:
            coo: Country of origin filter (ISO3 code, comma-separated for multiple)
            coa: Country of asylum filter (ISO3 code, comma-separated for multiple)
            year: Year filter (comma-separated for multiple years) - defaults to 2025
            coo_all: Set to True when analyzing the ORIGIN COUNTRIES of asylum seekers
            coa_all: Set to True when analyzing the ASYLUM COUNTRIES where applications were filed
    
        Returns:
            RSD application data from UNHCR API
        """
        return api_client.get_asylum_applications(
            coo=coo, coa=coa, year=year, coo_all=coo_all, coa_all=coa_all
        )
  • Helper method in UNHCRAPIClient class that calls the generic _fetch for the 'asylum-applications' UNHCR endpoint.
    def get_asylum_applications(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("asylum-applications", coo=coo, coa=coa, year=year, coo_all=coo_all, coa_all=coa_all)
  • Core helper method in UNHCRAPIClient that performs HTTP requests to the UNHCR API with dynamic parameters for filtering by country, year, etc.
    def _fetch(self, endpoint: str,
             coo: Optional[str] = None,
             coa: Optional[str] = None,
             year: Optional[Union[str, int]] = None,
             coo_all: bool = False,
             coa_all: bool = False,
             pop_type: Optional[bool] = None) -> dict[str, Any]:
        """
        Generic function to fetch data from various UNHCR API endpoints.
        """
        params = {"cf_type": "ISO"}
        
        if coo:
            params["coo"] = coo
        if coa:
            params["coa"] = coa
        if coo_all:
            params["coo_all"] = "true"
        if coa_all:
            params["coa_all"] = "true"
        
        if pop_type is True:
            params["pop_type"] = "true"            
        
        if year is None:
            # Default to 2025 as per previous implementation logic
            params["year[]"] = "2025"
        else:
            year_str = str(year)
            if "," in year_str:
                years = [y.strip() for y in year_str.split(",")]
                params["year[]"] = years
            else:
                params["year[]"] = year_str
        
        url = f"{self.BASE_URL}/{endpoint}/"
        
        try:
            logger.info(f"Fetching UNHCR {endpoint} data with params: {params}")
            response = requests.get(url, params=params)
            response.raise_for_status()
            return response.json()
        except requests.RequestException as e:
            logger.error(f"Error fetching UNHCR {endpoint} data: {e}")
            return {"error": str(e), "status": "error"}
  • Instantiation of the UNHCRAPIClient used by the tool handlers.
    api_client = UNHCRAPIClient()
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the data source (UNHCR API) and implies a read operation ('Get'), but doesn't cover important aspects like authentication requirements, rate limits, error handling, or whether it's a safe read operation. For a tool with 5 parameters and no annotations, this is insufficient.

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 well-structured with clear sections (purpose, args, returns) and uses bullet points effectively. Every sentence adds value, though the 'Returns' section could be more specific about the data format rather than just repeating 'RSD application data from UNHCR API.'

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

Completeness3/5

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

Given the tool has 5 parameters, no annotations, but has an output schema, the description is moderately complete. The parameter documentation is excellent, but behavioral aspects are under-specified. The output schema existence means the description doesn't need to detail return values, but other behavioral context is missing for a tool of this complexity.

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?

The description provides excellent parameter semantics that fully compensate for the 0% schema description coverage. For each of the 5 parameters, it explains: 1) what they filter (coo=country of origin, coa=country of asylum, year=year), 2) format requirements (ISO3 codes, comma-separated for multiple values), 3) defaults (year defaults to 2025), and 4) usage context (coo_all for analyzing origin countries, coa_all for analyzing asylum countries). This adds substantial value beyond the bare schema.

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 RSD application data from UNHCR.' It specifies the verb ('Get'), resource ('RSD application data'), and source ('UNHCR'). However, it doesn't explicitly differentiate this tool from its siblings (like get_rsd_decisions), which would be needed for a perfect score.

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 its siblings (get_demographics_data, get_population_data, get_rsd_decisions, get_solutions). It only documents parameters without explaining the tool's specific use case or how it differs from related tools.

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