Skip to main content
Glama
cfocoder

Banxico MCP Server

get_udis_data

Retrieve current and historical UDIS (Investment Units) data from Banxico. Specify the number of recent data points to access accurate financial indicators for analysis or planning.

Instructions

Get UDIS (Investment Units) data from Banxico.

Args: limit: Maximum number of recent data points (default: 30)

Returns: Current and historical UDIS values

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo

Implementation Reference

  • The handler function for the 'get_udis_data' MCP tool. It is registered via the @mcp.tool() decorator. Fetches UDIS data from Banxico API endpoint for series SP68257, handles authentication with BANXICO_API_TOKEN, applies an optional limit to recent data points, and formats the output using format_exchange_rate_data.
    @mcp.tool() async def get_udis_data(limit: Optional[int] = 30) -> str: """ Get UDIS (Investment Units) data from Banxico. Args: limit: Maximum number of recent data points (default: 30) Returns: Current and historical UDIS values """ if not BANXICO_TOKEN: return "Error: BANXICO_API_TOKEN environment variable not set. Please configure your API token." endpoint = "series/SP68257/datos" data = await make_banxico_request(endpoint, BANXICO_TOKEN) if not data: return "Failed to retrieve UDIS data. Please check your API token and network connection." # Apply limit if specified if limit and data.get("bmx", {}).get("series"): for series in data["bmx"]["series"]: if "datos" in series and len(series["datos"]) > limit: series["datos"] = series["datos"][-limit:] return format_exchange_rate_data(data)

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/cfocoder/banxico_mcp'

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