Skip to main content
Glama
llnOrmll

World Bank Data360 MCP Server

by llnOrmll

search_local_indicators

Search locally cached World Bank indicator metadata to discover available economic and social data types before API queries, providing instant results without network calls.

Instructions

Search through local metadata for World Bank indicators (instant, offline).

    This is a FAST alternative to search_datasets that searches through locally cached
    metadata. Use this to discover what types of data are available before using the
    API search.

    How it works:
    - Searches indicator names, codes, and descriptions
    - Instant results (no API call)
    - Returns relevance-ranked matches

    Search tips:
    - Use simple keywords: "unemployment", "poverty", "co2", "water"
    - Search works on indicator names AND descriptions
    - Case-insensitive
    - More specific queries = better results

    Example queries:
    - "unemployment" → finds all unemployment-related indicators
    - "mortality infant" → finds infant mortality indicators
    - "internet" → finds internet usage indicators
    - "renewable energy" → finds renewable energy indicators

    Parameters:
    - query: Search term (e.g., "unemployment", "gdp growth", "water access")
    - limit: Maximum number of results to return (default: 20)

    Returns: List of matching indicators with codes, names, descriptions, and relevance scores.

    Note: This returns indicator codes but NOT database IDs. After finding an indicator,
    use search_datasets with the indicator name to get the database ID needed for data retrieval.
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
limitNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The MCP tool handler for 'search_local_indicators'. Includes @server.tool() registration decorator, type-hinted parameters defining the input schema, comprehensive docstring, and delegates to the search_local_metadata helper for implementation.
    @server.tool()
    def search_local_indicators(query: str, limit: int = 20) -> dict[str, Any]:
        """Search through local metadata for World Bank indicators (instant, offline).
    
        This is a FAST alternative to search_datasets that searches through locally cached
        metadata. Use this to discover what types of data are available before using the
        API search.
    
        How it works:
        - Searches indicator names, codes, and descriptions
        - Instant results (no API call)
        - Returns relevance-ranked matches
    
        Search tips:
        - Use simple keywords: "unemployment", "poverty", "co2", "water"
        - Search works on indicator names AND descriptions
        - Case-insensitive
        - More specific queries = better results
    
        Example queries:
        - "unemployment" → finds all unemployment-related indicators
        - "mortality infant" → finds infant mortality indicators
        - "internet" → finds internet usage indicators
        - "renewable energy" → finds renewable energy indicators
    
        Parameters:
        - query: Search term (e.g., "unemployment", "gdp growth", "water access")
        - limit: Maximum number of results to return (default: 20)
    
        Returns: List of matching indicators with codes, names, descriptions, and relevance scores.
    
        Note: This returns indicator codes but NOT database IDs. After finding an indicator,
        use search_datasets with the indicator name to get the database ID needed for data retrieval.
        """
        return search_local_metadata(query, limit)
  • Core helper function implementing the search logic: loads local metadata, performs fuzzy search on indicator name/code/description with relevance scoring, sorts and limits results, formats output.
    def search_local_metadata(query: str, limit: int = 20) -> dict[str, Any]:
        """Search through local metadata (fast, offline)"""
        indicators = load_metadata()
    
        if not indicators:
            return {
                "success": False,
                "error": "Metadata file not found. Please ensure metadata_indicators.json exists."
            }
    
        query_lower = query.lower()
        results = []
    
        # Search through indicators
        for indicator in indicators:
            name_lower = indicator["name"].lower()
            desc_lower = indicator["description"].lower()
            code_lower = indicator["code"].lower()
    
            # Calculate relevance score
            score = 0
    
            # Exact match in code (highest priority)
            if query_lower == code_lower:
                score = 100
            # Contains in code
            elif query_lower in code_lower:
                score = 90
            # Exact word match in name
            elif query_lower in name_lower.split():
                score = 80
            # Contains in name (high priority)
            elif query_lower in name_lower:
                score = 70
            # Contains in description (lower priority)
            elif query_lower in desc_lower:
                score = 40
            else:
                continue
    
            results.append({
                "indicator": indicator["code"],
                "name": indicator["name"],
                "description": indicator["description"][:200] + "..." if len(indicator["description"]) > 200 else indicator["description"],
                "source": indicator["source"][:100] + "..." if len(indicator["source"]) > 100 else indicator["source"],
                "relevance_score": score
            })
    
        # Sort by relevance score
        results.sort(key=lambda x: x["relevance_score"], reverse=True)
    
        # Limit results
        results = results[:limit]
    
        return {
            "success": True,
            "query": query,
            "total_matches": len(results),
            "results": results,
            "note": "Local search - instant results from cached metadata"
        }
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: 'instant, offline' operation, 'no API call,' 'returns relevance-ranked matches,' and 'instant results.' It also clarifies what is NOT returned ('indicator codes but NOT database IDs'). However, it doesn't mention potential limitations like cache freshness or what happens with no matches.

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, how it works, search tips, examples, parameters, returns, note) and front-loads key information. While comprehensive, some sections like the example queries could be more concise. Every sentence adds value, but there's minor verbosity in the examples.

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 (search functionality with behavioral nuances), no annotations, and an output schema (which handles return values), the description is remarkably complete. It covers purpose, usage guidelines, behavioral traits, parameter semantics, workflow integration with siblings, and practical examples, leaving no significant gaps for the agent.

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 schema description coverage is 0%, so the description must compensate. It provides meaningful context for both parameters: 'query' is explained with examples and search tips (e.g., 'simple keywords,' 'case-insensitive'), and 'limit' is clarified as 'maximum number of results to return' with the default value. 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.

Purpose5/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: searching through locally cached metadata for World Bank indicators. It specifies the verb 'search' and resource 'local metadata for World Bank indicators,' and explicitly distinguishes it from the sibling 'search_datasets' tool by noting this is a 'FAST alternative' for discovering available data types before API search.

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. It states 'Use this to discover what types of data are available before using the API search' and names the specific alternative 'search_datasets.' It also includes a note explaining the workflow: after finding indicators here, use search_datasets to get database IDs for data retrieval.

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