Skip to main content
Glama
kea0811
by kea0811

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

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

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,
      };
    });
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. While 'Get' implies a read-only operation, it doesn't specify authentication requirements, rate limits, pagination behavior (beyond the 'pageSize' parameter), or what 'activity history' entails (e.g., logs, transactions). For a tool with no annotation coverage, this leaves significant gaps in understanding its behavior and constraints.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with just four words, front-loading the core purpose without any fluff. Every word ('Get account activity history') directly contributes to understanding the tool's function, making it efficient and easy to parse. This minimalism is effective for basic clarity, though it sacrifices depth.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of retrieving account activity (which could involve sensitive data or pagination) and the absence of both annotations and an output schema, the description is insufficient. It doesn't explain what 'activity history' includes, how results are structured, or any behavioral aspects like error handling. For a tool with no structured metadata, more descriptive context is needed to ensure proper usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, clearly documenting all four parameters (detailed, from, pageSize, to) with their types and purposes. The description adds no additional parameter semantics beyond what's in the schema, such as explaining how 'detailed' affects the output or date format nuances. With high schema coverage, a baseline score of 3 is appropriate as the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get account activity history' clearly states the verb 'Get' and resource 'account activity history', which is specific enough to understand the basic function. However, it doesn't distinguish this tool from potential siblings like 'ig_get_accounts' or 'ig_get_positions' that might also retrieve account-related information, leaving ambiguity about what makes this tool unique.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'ig_get_accounts' and 'ig_get_positions' that might overlap in retrieving account data, there's no indication of context, prerequisites, or exclusions. This lack of differentiation could lead to confusion for an AI agent selecting between similar tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related 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