ig_get_watchlists
Retrieve all watchlists for forex, indices, and commodities trading via the IG Trading API. Simplify market data analysis and portfolio management by accessing curated lists of instruments.
Instructions
Get all watchlists
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/services/ig-service.js:425-433 (handler)Core implementation of the ig_get_watchlists tool. Fetches all watchlists from the IG API endpoint '/watchlists' and returns the response data.async getWatchlists() { try { const response = await this.apiClient.get('/watchlists'); return response.data; } catch (error) { logger.error('Failed to get watchlists:', error.message); throw error; } }
- src/services/mcp-service.js:733-742 (handler)MCP server tool handler for ig_get_watchlists. Calls IGService.getWatchlists() and formats the response as MCP content.case 'ig_get_watchlists': const watchlists = await igService.getWatchlists(); return { content: [ { type: 'text', text: JSON.stringify(watchlists, null, 2), }, ], };
- src/services/mcp-service.js:441-448 (schema)Input schema and tool metadata definition for ig_get_watchlists, used in tool listing and validation.{ name: 'ig_get_watchlists', description: 'Get all watchlists', inputSchema: { type: 'object', properties: {}, }, },
- src/services/mcp-service.js:506-510 (registration)Registration of tool list handler that exposes the ig_get_watchlists tool via the TOOLS array.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: TOOLS, }; });