Skip to main content
Glama
enderekici

Trading 212 MCP Server

by enderekici

get_order_history

Retrieve past trading orders with pagination and filtering options to analyze transaction history and track investment performance.

Instructions

Get historical orders with pagination support

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cursorNoPagination cursor for fetching next page
limitNoMaximum number of results to return (default 50)
tickerNoFilter by ticker symbol

Implementation Reference

  • Tool handler in the main MCP switch block.
    case 'get_order_history': {
      const { cursor, limit, ticker } = PaginatedWithTickerInputSchema.parse(args);
      const history = await client.getOrderHistory({ cursor, limit, ticker });
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(history, null, 2),
          },
        ],
      };
  • Actual API client implementation for fetching order history.
    async getOrderHistory(params?: {
      cursor?: number;
      limit?: number;
      ticker?: string;
    }): Promise<{ items: HistoricalOrder[]; nextPagePath?: string }> {
      const queryParams = new URLSearchParams();
      if (params?.cursor) queryParams.append('cursor', params.cursor.toString());
      if (params?.limit) queryParams.append('limit', params.limit.toString());
      if (params?.ticker) queryParams.append('ticker', params.ticker);
    
      const endpoint = `/equity/history/orders${queryParams.toString() ? `?${queryParams.toString()}` : ''}`;
      const response = await this.request<{ items: unknown[]; nextPagePath?: string }>(endpoint);
    
      return {
        items: z.array(HistoricalOrderSchema).parse(response.items),
        nextPagePath: response.nextPagePath,
      };
    }
Behavior2/5

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

With no annotations provided, the description carries full burden but only mentions pagination support. It lacks details on permissions, rate limits, error handling, or return format (e.g., structure of historical orders). This leaves significant behavioral gaps for a read operation.

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

Conciseness4/5

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

The description is brief and front-loaded with the core purpose. It wastes no words but could be slightly more informative without losing conciseness, such as by clarifying the historical aspect or differentiating from siblings.

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?

For a tool with 3 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what 'historical orders' entails (e.g., time range, statuses), the response format, or how pagination works beyond cursor/limit, leaving key contextual gaps.

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?

Schema description coverage is 100%, so parameters are well-documented in the schema. The description adds no additional parameter semantics beyond implying historical scope, which is minimal value. Baseline 3 is appropriate as the schema handles most documentation.

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

Purpose4/5

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

The description clearly states the action ('Get historical orders') and mentions a key feature ('with pagination support'), which distinguishes it from simple retrieval tools. However, it doesn't explicitly differentiate from sibling tools like 'get_orders' or 'get_order', leaving some ambiguity about scope.

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?

No guidance is provided on when to use this tool versus alternatives like 'get_orders' or 'get_order'. The description implies historical data retrieval but doesn't specify contexts, prerequisites, or exclusions, offering minimal usage direction.

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

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/enderekici/trading212-mcp'

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