Skip to main content
Glama
enderekici

Trading 212 MCP Server

by enderekici

get_transactions

Retrieve transaction history for deposits, withdrawals, orders, dividends, and fees from Trading 212 investment accounts to track financial activity and analyze portfolio performance.

Instructions

Get transaction history including deposits, withdrawals, orders, dividends, and fees

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cursorNoPagination cursor for fetching next page
limitNoMaximum number of results to return

Implementation Reference

  • The actual implementation of getTransactions on the client class.
    async getTransactions(params?: {
      cursor?: number;
      limit?: number;
    }): Promise<{ items: Transaction[]; nextPagePath?: string }> {
      const queryParams = new URLSearchParams();
      if (params?.cursor) queryParams.append('cursor', params.cursor.toString());
      if (params?.limit) queryParams.append('limit', params.limit.toString());
    
      const endpoint = `/equity/history/transactions${queryParams.toString() ? `?${queryParams.toString()}` : ''}`;
      const response = await this.request<{ items: unknown[]; nextPagePath?: string }>(endpoint);
    
      return {
        items: z.array(TransactionSchema).parse(response.items),
        nextPagePath: response.nextPagePath,
      };
    }
  • The MCP tool handler for 'get_transactions' which calls the client method.
    case 'get_transactions': {
      const { cursor, limit } = PaginatedInputSchema.parse(args);
      const transactions = await client.getTransactions({ cursor, limit });
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(transactions, null, 2),
          },
        ],
      };
    }

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