Skip to main content
Glama

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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; } }
  • 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), }, ], };
  • 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: {}, }, },

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/kea0811/ig-trading-mcp'

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