ig_get_accounts
Retrieve a comprehensive list of all trading accounts associated with the IG Trading API, enabling efficient account management for forex, indices, and commodities trading.
Instructions
Get list of all trading accounts
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/services/ig-service.js:86-94 (handler)Core implementation of ig_get_accounts tool: fetches all trading accounts from IG API via GET /accounts endpoint, handles errors.async getAccounts() { try { const response = await this.apiClient.get('/accounts'); return response.data; } catch (error) { logger.error('Failed to get accounts:', error.message); throw error; } }
- src/services/mcp-service.js:556-565 (handler)MCP server handler for ig_get_accounts tool: delegates to IGService.getAccounts() and returns formatted JSON response.case 'ig_get_accounts': const accounts = await igService.getAccounts(); return { content: [ { type: 'text', text: JSON.stringify(accounts, null, 2), }, ], };
- src/services/mcp-service.js:92-99 (registration)Tool registration in TOOLS array: defines name, description, and empty input schema for listing in MCP.{ name: 'ig_get_accounts', description: 'Get list of all trading accounts', inputSchema: { type: 'object', properties: {}, }, },