get_market_calendar
Retrieve economic calendar data for specific months to track market and political events. Provide a date parameter in YYYY-MM format or get current month events automatically.
Instructions
Get economic calendar for specified month. Shows important market or political events. Parameter: date (optional) in format YYYY-MM (e.g., 2025-09). If not provided, returns current month data / 获取指定月份的经济日历,重要市场或政治事件。参数:date(可选)格式 YYYY-MM(如 2025-09),不传参表示获取当前月份
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | No | Year-month in format YYYY-MM (e.g., 2025-09). If not provided, returns current month / 年月格式 YYYY-MM(如 2025-09),不传参表示获取当前月份 |
Implementation Reference
- src/desk3_service/server.py:221-235 (handler)The core handler function implementing the get_market_calendar tool logic by querying the external Desk3 API endpoint.async def get_market_calendar(date: str | None = None) -> dict[str, Any]: """ Get economic calendar for specified month. Shows important market or political events. :param date: Year-month in format YYYY-MM (e.g., 2025-09). If not provided, returns current month :return: Economic calendar data with events organized by day """ url = 'https://mcp.desk3.io/v1/market/calendar' params = {} if date: params['date'] = date try: return request_api('get', url, params=params) except Exception as e: raise RuntimeError(f"Failed to fetch market calendar data: {e}")
- src/desk3_service/server.py:681-696 (registration)Registration of the get_market_calendar tool in list_tools(), including name, description, and JSON schema for input validation.types.Tool( name="get_market_calendar", description="Get economic calendar for specified month. Shows important market or political events. Parameter: date (optional) in format YYYY-MM (e.g., 2025-09). If not provided, returns current month data / 获取指定月份的经济日历,重要市场或政治事件。参数:date(可选)格式 YYYY-MM(如 2025-09),不传参表示获取当前月份", inputSchema={ "type": "object", "properties": { "date": { "type": "string", "description": "Year-month in format YYYY-MM (e.g., 2025-09). If not provided, returns current month / 年月格式 YYYY-MM(如 2025-09),不传参表示获取当前月份", "examples": ["2025-09", "2025-10", "2025-01"], "pattern": "^[0-9]{4}-[0-9]{2}$" }, }, "required": [], }, )
- src/desk3_service/server.py:684-695 (schema)JSON Schema defining the input parameters for the get_market_calendar tool (optional 'date' parameter).inputSchema={ "type": "object", "properties": { "date": { "type": "string", "description": "Year-month in format YYYY-MM (e.g., 2025-09). If not provided, returns current month / 年月格式 YYYY-MM(如 2025-09),不传参表示获取当前月份", "examples": ["2025-09", "2025-10", "2025-01"], "pattern": "^[0-9]{4}-[0-9]{2}$" }, }, "required": [], },
- src/desk3_service/server.py:883-895 (handler)MCP tool call handler in @server.call_tool() that parses arguments, invokes the get_market_calendar function, and returns the JSON response.case "get_market_calendar": date = arguments.get("date") if arguments else None try: data = await get_market_calendar(date=date) return [ types.TextContent( type="text", text=json.dumps(data, indent=2), ) ] except Exception as e: raise RuntimeError(f"Failed to fetch market calendar data: {e}") case _: