Skip to main content
Glama
enderekici

Trading 212 MCP Server

by enderekici

get_portfolio

Retrieve current portfolio holdings including positions, quantities, prices, and profit/loss data from Trading 212 investment accounts.

Instructions

List all open positions in the portfolio with current prices, quantities, and profit/loss

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler logic for the 'get_portfolio' tool, which calls the client's getPositions method and returns the result as formatted JSON.
    case 'get_portfolio': {
      const portfolio = await client.getPositions();
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(portfolio, null, 2),
          },
        ],
      };
    }
  • src/index.ts:91-100 (registration)
    Registration of the 'get_portfolio' tool, including its name, description, and empty input schema.
    // Portfolio/Positions Tools
    {
      name: 'get_portfolio',
      description:
        'List all open positions in the portfolio with current prices, quantities, and profit/loss',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },

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