Skip to main content
Glama
enderekici

Trading 212 MCP Server

by enderekici

create_pie

Build a diversified investment portfolio by allocating percentages to specific instruments and setting dividend reinvestment preferences.

Instructions

Create a new investment pie with specified instruments and allocations

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of the pie (1-50 characters)
iconYesIcon identifier for the pie
instrumentSharesYesObject mapping ticker symbols to their percentage allocation (e.g., {"AAPL": 0.5, "GOOGL": 0.5})
dividendCashActionYesWhat to do with dividend cash
goalNoOptional investment goal amount

Implementation Reference

  • The tool handler for 'create_pie' in the MCP server, which validates the input using CreatePieRequestSchema and calls client.createPie.
    case 'create_pie': {
      const validated = CreatePieRequestSchema.parse(args);
      const pie = await client.createPie(validated);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(pie, null, 2),
          },
        ],
      };
    }
  • Input validation schema for creating a pie.
    export const CreatePieRequestSchema = z.object({
      dividendCashAction: z.enum(['REINVEST', 'TO_ACCOUNT_CASH']),
      goal: z.number().positive().optional(),
      icon: z.string(),
      instrumentShares: z.record(z.string(), z.number()),
      name: z.string().min(1).max(50),
    });

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