Skip to main content
Glama
enderekici

Trading 212 MCP Server

by enderekici

get_dividends

Retrieve dividend payment history for specific stocks with pagination support to track investment income over time.

Instructions

Get dividend payment history with pagination support

Input Schema

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

Implementation Reference

  • MCP tool handler for 'get_dividends' which calls the client method.
    case 'get_dividends': {
      const { cursor, limit, ticker } = PaginatedWithTickerInputSchema.parse(args);
      const dividends = await client.getDividends({ cursor, limit, ticker });
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(dividends, null, 2),
          },
        ],
      };
    }
  • Actual client implementation for fetching dividend history.
    async getDividends(params?: {
      cursor?: number;
      limit?: number;
      ticker?: string;
    }): Promise<{ items: Dividend[]; 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/dividends${queryParams.toString() ? `?${queryParams.toString()}` : ''}`;
      const response = await this.request<{ items: unknown[]; nextPagePath?: string }>(endpoint);
    
      return {
        items: z.array(DividendSchema).parse(response.items),
        nextPagePath: response.nextPagePath,
      };
    }

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