Skip to main content
Glama

ig_get_account_activity

Retrieve account activity history within specified dates for IG Trading accounts. Use filters for detailed data, pagination, and date range to analyze transactions and monitor trading activity.

Instructions

Get account activity history

Input Schema

NameRequiredDescriptionDefault
detailedNoInclude detailed information
fromNoStart date (YYYY-MM-DD)
pageSizeNoNumber of results per page
toNoEnd date (YYYY-MM-DD)

Input Schema (JSON Schema)

{ "properties": { "detailed": { "default": false, "description": "Include detailed information", "type": "boolean" }, "from": { "description": "Start date (YYYY-MM-DD)", "type": "string" }, "pageSize": { "default": 500, "description": "Number of results per page", "type": "number" }, "to": { "description": "End date (YYYY-MM-DD)", "type": "string" } }, "type": "object" }

Implementation Reference

  • The core handler function in IGService that constructs query parameters from input and makes an authenticated API call to retrieve account activity history from the IG REST API endpoint `/history/activity`.
    async getAccountActivity(options = {}) { const { from = '1990-01-01', to = '2099-01-01', detailed = false, dealId = null, pageSize = 500 } = options; const params = new URLSearchParams({ from, to, detailed: detailed.toString(), pageSize: pageSize.toString() }); if (dealId) params.append('dealId', dealId); try { const response = await this.apiClient.get(`/history/activity?${params}`, 3); return response.data; } catch (error) { logger.error('Failed to get account activity:', error.message); throw error; } }
  • Tool schema definition including name, description, and input schema for validation in the MCP tool list.
    { name: 'ig_get_account_activity', description: 'Get account activity history', inputSchema: { type: 'object', properties: { from: { type: 'string', description: 'Start date (YYYY-MM-DD)', }, to: { type: 'string', description: 'End date (YYYY-MM-DD)', }, detailed: { type: 'boolean', description: 'Include detailed information', default: false, }, pageSize: { type: 'number', description: 'Number of results per page', default: 500, }, }, }, },
  • MCP server handler case that receives tool call parameters, invokes the IGService method, and formats the response as MCP content.
    case 'ig_get_account_activity': const activity = await igService.getAccountActivity(args); return { content: [ { type: 'text', text: JSON.stringify(activity, null, 2), }, ], };
  • Registration of the tool list handler that exposes all tools including 'ig_get_account_activity' via the TOOLS array.
    server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: TOOLS, }; });

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