get_historical_news
Retrieve historical news headlines for specific financial instruments using Interactive Brokers data. Specify contract ID and provider codes to access past market news.
Instructions
Get historical news headlines.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| con_id | Yes | Contract ID | |
| provider_codes | Yes | Comma-separated provider codes | |
| total_results | No |
Implementation Reference
- src/ib_async_mcp/server.py:791-806 (handler)The handler function that executes 'get_historical_news' using ib.reqHistoricalNewsAsync.
if name == "get_historical_news": news = await ib.reqHistoricalNewsAsync( args["con_id"], args["provider_codes"], "", "", args.get("total_results", 10), ) if news: return { "time": news.time.isoformat() if news.time else None, "provider_code": news.providerCode, "article_id": news.articleId, "headline": news.headline, } return {"error": "No news found"} - src/ib_async_mcp/server.py:411-422 (registration)The registration of 'get_historical_news' as a tool in the MCP server list_tools.
name="get_historical_news", description="Get historical news headlines.", inputSchema={ "type": "object", "properties": { "con_id": {"type": "integer", "description": "Contract ID"}, "provider_codes": {"type": "string", "description": "Comma-separated provider codes"}, "total_results": {"type": "integer", "default": 10}, }, "required": ["con_id", "provider_codes"], }, ),