Skip to main content
Glama
llnOrmll

World Bank Data360 MCP Server

by llnOrmll

search_datasets_tool

Search World Bank Data360 for datasets to find indicator and database IDs needed for retrieving economic and social development data.

Instructions

[STEP 1/3] Search World Bank Data360 for datasets.

    <purpose>
        Search World Bank Data360 for datasets. This is STEP 1 of 3 in the data retrieval workflow.
        Find indicator IDs and database IDs needed for subsequent data operations.
    </purpose>

    <workflow>
        <step number="1">search_datasets (this tool) - Find indicator ID and database ID</step>
        <step number="2">get_temporal_coverage - Check available years BEFORE retrieving data</step>
        <step number="3">retrieve_data - Fetch actual data with proper year and limit parameters</step>
    </workflow>

    <optimization_tips>
        <tip>Remove punctuation: "GDP, total" becomes "GDP total"</tip>
        <tip>Expand abbreviations: "GDP" becomes "Gross Domestic Product"</tip>
        <tip>Add "total" for aggregates: "population" becomes "population total"</tip>
        <tip>Use lowercase for consistency</tip>
        <tip>Remove filler words: "data", "statistics"</tip>
    </optimization_tips>

    <common_databases>
        <database id="WB_WDI">World Development Indicators (most comprehensive)</database>
        <database id="WB_HNP">Health, Nutrition and Population</database>
        <database id="WB_GDF">Global Development Finance</database>
    </common_databases>

    <examples>
        <example original="GDP">gross domestic product total</example>
        <example original="population data">population total</example>
        <example original="">poverty headcount ratio</example>
    </examples>

    <returns>
        List of datasets with indicator IDs, names, database IDs, and search scores.
    </returns>

    <next_step>
        Call get_temporal_coverage with the indicator and database from results.
    </next_step>

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
search_queryYes
topNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function for the 'search_datasets_tool' tool. Registered with @server.tool() decorator. Includes detailed docstring serving as tool description/schema and calls the core search_datasets helper function.
    @server.tool()
    def search_datasets_tool(search_query: str, top: int = 20) -> dict[str, Any]:
        """[STEP 1/3] Search World Bank Data360 for datasets.
        
        <purpose>
            Search World Bank Data360 for datasets. This is STEP 1 of 3 in the data retrieval workflow.
            Find indicator IDs and database IDs needed for subsequent data operations.
        </purpose>
    
        <workflow>
            <step number="1">search_datasets (this tool) - Find indicator ID and database ID</step>
            <step number="2">get_temporal_coverage - Check available years BEFORE retrieving data</step>
            <step number="3">retrieve_data - Fetch actual data with proper year and limit parameters</step>
        </workflow>
    
        <optimization_tips>
            <tip>Remove punctuation: "GDP, total" becomes "GDP total"</tip>
            <tip>Expand abbreviations: "GDP" becomes "Gross Domestic Product"</tip>
            <tip>Add "total" for aggregates: "population" becomes "population total"</tip>
            <tip>Use lowercase for consistency</tip>
            <tip>Remove filler words: "data", "statistics"</tip>
        </optimization_tips>
    
        <common_databases>
            <database id="WB_WDI">World Development Indicators (most comprehensive)</database>
            <database id="WB_HNP">Health, Nutrition and Population</database>
            <database id="WB_GDF">Global Development Finance</database>
        </common_databases>
    
        <examples>
            <example original="GDP">gross domestic product total</example>
            <example original="population data">population total</example>
            <example original="">poverty headcount ratio</example>
        </examples>
    
        <returns>
            List of datasets with indicator IDs, names, database IDs, and search scores.
        </returns>
    
        <next_step>
            Call get_temporal_coverage with the indicator and database from results.
        </next_step>"""
        return search_datasets(search_query, top)
  • Core helper function implementing the dataset search logic by making a POST request to the World Bank Data360 search API endpoint, processing the response, and formatting results with indicator IDs, names, databases, and search scores.
    def search_datasets(search_query: str, top: int = 20) -> dict[str, Any]:
        """Search World Bank Data360 API"""
        payload = {
            "count": True,
            "select": "series_description/idno, series_description/name, series_description/database_id",
            "search": search_query,
            "top": top,
        }
    
        try:
            response = requests.post(
                SEARCH_ENDPOINT,
                json=payload,
                headers={"Content-Type": "application/json", "Accept": "application/json"},
                timeout=30,
            )
            response.raise_for_status()
            data = response.json()
            
            # Format results nicely
            results = []
            for item in data.get("value", []):
                series = item.get("series_description", {})
                results.append({
                    "indicator": series.get("idno"),
                    "name": series.get("name"),
                    "database": series.get("database_id"),
                    "search_score": round(item.get("@search.score", 0), 2)
                })
            
            return {
                "success": True,
                "total_count": data.get("@odata.count", 0),
                "results": results
            }
            
        except Exception as e:
            return {"success": False, "error": str(e)}
Behavior4/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 effectively describes key behavioral traits: it's a search operation (implied read-only), returns a list of datasets with specific fields (indicator IDs, names, database IDs, search scores), and includes optimization tips for query formatting (e.g., removing punctuation, expanding abbreviations). However, it lacks details on error handling, rate limits, or authentication needs, which are minor gaps given the context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

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

The description is structured with XML-like tags (<purpose>, <workflow>, etc.), which aids organization but adds verbosity. Each section earns its place by providing workflow context, optimization tips, and examples, but the formatting could be more streamlined. It's appropriately sized for the tool's complexity but not maximally concise due to the markup style.

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

Completeness5/5

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

Given the tool's complexity (2 parameters, no annotations, 0% schema coverage, but with an output schema), the description is highly complete. It covers purpose, workflow integration, parameter usage tips, common databases, examples, return values, and next steps. The presence of an output schema means the description doesn't need to detail return formats, and it effectively fills all other contextual gaps, making it sufficient for an agent to use the tool correctly.

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

Parameters4/5

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

The input schema has 0% description coverage, so the description must compensate. It adds significant meaning beyond the schema: it explains that 'search_query' should be optimized using the provided tips (e.g., 'Remove punctuation') and implies 'top' controls result count with a default of 20. While it doesn't detail parameter constraints or formats explicitly, the examples and tips offer practical guidance, adequately compensating for the schema gap.

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 explicitly states the tool's purpose as 'Search World Bank Data360 for datasets' and distinguishes it from siblings by positioning it as 'STEP 1 of 3 in the data retrieval workflow' and specifying it finds 'indicator IDs and database IDs needed for subsequent data operations.' This clearly differentiates it from tools like 'retrieve_data_tool' or 'search_local_indicators' by focusing on metadata discovery rather than data retrieval or local searches.

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 versus alternatives through the <workflow> section, which outlines a three-step process where this tool is step 1 for finding IDs, followed by 'get_temporal_coverage' and 'retrieve_data.' It also lists sibling tools like 'list_popular_indicators' and 'search_local_indicators' in context, though it doesn't explicitly contrast them, the workflow implies this tool is for initial searches in the broader retrieval process.

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/llnOrmll/world-bank-data-mcp'

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