Skip to main content
Glama
c-cf

IMF Data MCP Server

by c-cf

list_indicators

Retrieve a list of indicators for a specified dataset, such as 'IFS', 'DOT', or 'BOP', from the local indicators directory. Simplifies data access and analysis with JSON file integration.

Instructions

Returns a list of indicators for the specified dataset, read from the corresponding .json file in the local indicators directory. Args: dataset_id (str): Dataset ID, such as "IFS", "DOT", "BOP", etc. Returns: list: List of indicators.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataset_idYes

Implementation Reference

  • The handler function for the 'list_indicators' tool, which reads and returns indicators from a local JSON file for the given dataset_id. The @mcp.tool() decorator registers it as an MCP tool.
    @mcp.tool() def list_indicators(dataset_id: str) -> list: """ Returns a list of indicators for the specified dataset, read from the corresponding .json file in the local indicators directory. Args: dataset_id (str): Dataset ID, such as "IFS", "DOT", "BOP", etc. Returns: list: List of indicators. """ file_path = os.path.join(os.path.dirname(__file__), "resources", "indicators", f"{dataset_id.lower()}.json") try: with open(file_path, 'r', encoding='utf-8') as file: data = json.load(file) return data except FileNotFoundError: return {"error": f"File not found: {file_path}"} except json.JSONDecodeError: return {"error": f"Error decoding JSON from file: {file_path}"} except Exception as e: return {"error": f"Error reading file: {str(e)}"}

Other Tools

Related 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/c-cf/imf-data-mcp'

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