Skip to main content
Glama
llnOrmll

World Bank Data360 MCP Server

by llnOrmll

get_temporal_coverage_tool

Check available years for World Bank datasets to ensure valid data retrieval by identifying temporal coverage before downloading.

Instructions

[STEP 2/3] Get available years for a specific dataset.

    CRITICAL: Always call this BEFORE retrieve_data to avoid errors.
    
    Workflow:
    1. search_datasets - Done ✓
    2. get_temporal_coverage (this tool) - Check what years are available
    3. retrieve_data - Use latest_year from this response
    
    Returns: start_year, end_year, latest_year, and full list of available years.
    Next step: Call retrieve_data with year=latest_year.
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
indicatorYes
databaseYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The MCP tool handler decorated with @server.tool(). This is the entry point for the 'get_temporal_coverage_tool' tool, which validates inputs via type hints and delegates execution to the core helper function.
    def get_temporal_coverage_tool(indicator: str, database: str) -> dict[str, Any]:
        """[STEP 2/3] Get available years for a specific dataset.
        
        CRITICAL: Always call this BEFORE retrieve_data to avoid errors.
        
        Workflow:
        1. search_datasets - Done ✓
        2. get_temporal_coverage (this tool) - Check what years are available
        3. retrieve_data - Use latest_year from this response
        
        Returns: start_year, end_year, latest_year, and full list of available years.
        Next step: Call retrieve_data with year=latest_year.
        """
        return get_temporal_coverage(indicator, database)
  • Core helper function containing the actual API call to retrieve temporal coverage (start_year, end_year) from World Bank metadata endpoint for the specified indicator.
    def get_temporal_coverage(indicator: str, database: str) -> dict[str, Any]:
        """Get available years for a dataset"""
        try:
            payload = {
                "query": f"&$filter=series_description/idno eq '{indicator}'"
            }
            
            response = requests.post(
                METADATA_ENDPOINT,
                json=payload,
                headers={"Content-Type": "application/json", "Accept": "application/json"},
                timeout=30
            )
            response.raise_for_status()
            
            metadata = response.json()
            values = metadata.get("value", [])
            
            if not values:
                return {"success": False, "error": "No metadata found"}
            
            series_desc = values[0].get("series_description", {})
            time_periods = series_desc.get("time_periods", [])
            
            if time_periods:
                period = time_periods[0]
                start_year = int(period.get("start", 0))
                end_year = int(period.get("end", 0))
                
                return {
                    "success": True,
                    "start_year": start_year,
                    "end_year": end_year,
                    "latest_year": end_year,
                    "available_years": list(range(start_year, end_year + 1))
                }
            
            return {"success": False, "error": "No temporal data available"}
            
        except Exception as e:
            return {"success": False, "error": str(e)}
  • The @server.tool() decorator registers this function as an MCP tool named 'get_temporal_coverage_tool' in the FastMCP server.
    def get_temporal_coverage_tool(indicator: str, database: str) -> dict[str, Any]:
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 the tool's role in a workflow, its prerequisite nature, and what it returns (start_year, end_year, latest_year, full list). However, it doesn't mention potential errors, rate limits, or authentication needs, leaving some behavioral aspects uncovered.

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, critical note, workflow, returns, next step) and uses bullet points for readability. It's appropriately sized for its complexity, though the workflow repetition and imperative tone ('Done ✓', 'Check') could be slightly streamlined without losing clarity.

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 moderate complexity, no annotations, and the presence of an output schema, the description is complete enough. It covers purpose, usage context, workflow integration, return values, and next steps. The output schema will handle detailed return structure, so the description appropriately focuses on higher-level guidance.

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. While it doesn't explicitly explain the 'indicator' and 'database' parameters, it contextualizes them by stating this tool is for 'a specific dataset' after search_datasets, implying these parameters identify that dataset. This adds meaningful semantics beyond the bare schema, though not exhaustive parameter details.

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 with specific verbs ('Get available years') and resources ('for a specific dataset'), distinguishing it from siblings like retrieve_data_tool (which fetches actual data) and search_datasets_tool (which finds datasets). It explicitly mentions what it returns, making the purpose unambiguous.

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, stating it should 'Always call this BEFORE retrieve_data to avoid errors' and outlining a workflow with steps 1-3. It differentiates from alternatives by positioning this as a prerequisite to retrieve_data_tool, with clear sequencing instructions.

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