Skip to main content
Glama
rvibek

UNHCR Population Data MCP Server

get_rsd_decisions

Retrieve UNHCR Refugee Status Determination decisions data filtered by country of origin, country of asylum, and year for analysis.

Instructions

    Get Refugee Status Determination (RSD) decision 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 decisions breakdown BY NATIONALITY
        coa_all: Set to True when analyzing decisions breakdown BY COUNTRY

    Returns:
        RSD decision 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 main handler function for the 'get_rsd_decisions' tool, registered with @server.tool(). It delegates to the UNHCRAPIClient's get_asylum_decisions method to fetch RSD decision data from the UNHCR API.
    @server.tool()
    def get_rsd_decisions(
        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 Refugee Status Determination (RSD) decision 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 decisions breakdown BY NATIONALITY
            coa_all: Set to True when analyzing decisions breakdown BY COUNTRY
    
        Returns:
            RSD decision data from UNHCR API
        """
        return api_client.get_asylum_decisions(
            coo=coo, coa=coa, year=year, coo_all=coo_all, coa_all=coa_all
        )
  • Helper method in the UNHCRAPIClient class that performs the API fetch specifically for asylum decisions (RSD decisions) using the generic _fetch method with endpoint 'asylum-decisions'.
    def get_asylum_decisions(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-decisions", coo=coo, coa=coa, year=year, coo_all=coo_all, coa_all=coa_all)
  • The core generic fetch method used by all API client methods, including get_asylum_decisions, to make HTTP requests to the UNHCR API with appropriate parameters.
    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"}
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') but lacks critical details such as rate limits, authentication requirements, error handling, or whether this is a read-only operation. The description does not contradict annotations, but it is insufficient for a tool with no annotation coverage.

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 a purpose statement followed by parameter explanations and a returns section. It is appropriately sized, though the parameter explanations could be slightly more concise. Every sentence adds value, and it is front-loaded with the core purpose.

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 complexity (5 parameters, no annotations) and the presence of an output schema (which handles return values), the description is mostly complete. It covers all parameters semantically and states the data source. However, it lacks behavioral context like rate limits or authentication, which is a gap despite the output schema.

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 clear semantic explanations for all 5 parameters, including ISO3 code formats, comma-separated lists for multiple values, default values (year defaults to 2025), and the purpose of boolean flags (coo_all for nationality breakdown, coa_all for country breakdown). This adds significant value beyond the bare schema.

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 ('Refugee Status Determination (RSD) decision data from UNHCR'), making the purpose specific and unambiguous. It distinguishes this tool from siblings like 'get_rsd_applications' by focusing on decisions rather than applications.

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

Usage Guidelines3/5

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

The description implies usage through parameter explanations (e.g., 'when analyzing decisions breakdown BY NATIONALITY'), but it does not explicitly state when to use this tool versus alternatives like 'get_population_data' or 'get_solutions'. No clear exclusions or prerequisites are provided.

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