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),
    });
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states this is a creation operation but doesn't mention whether this requires authentication, what permissions are needed, whether there are rate limits, what happens on success/failure, or if the creation is irreversible. For a tool that creates financial instruments, this is a significant gap in safety and operational context.

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 a single, efficient sentence that gets straight to the point without unnecessary words. It's appropriately sized for a creation tool, though it could potentially benefit from being slightly more informative given the lack of annotations.

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 that creates financial investment instruments with 5 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what happens after creation, whether there are validation rules beyond schema constraints, how to handle errors, or what the user should expect as a result. The context signals show this is a non-trivial operation with nested objects and required parameters, warranting more comprehensive guidance.

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?

The description mentions 'specified instruments and allocations' which maps to the 'instrumentShares' parameter, but doesn't add meaningful context beyond what the schema already provides. With 100% schema description coverage, the baseline is 3 - the schema does the heavy lifting for parameter documentation, and the description doesn't compensate with additional semantic value.

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 ('Create a new investment pie') and specifies what it creates ('with specified instruments and allocations'), which is a specific verb+resource combination. However, it doesn't differentiate from sibling tools like 'update_pie' or explain what makes 'create' distinct from modification operations.

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?

The description provides no guidance on when to use this tool versus alternatives like 'update_pie' or when not to use it. There's no mention of prerequisites, dependencies, or appropriate contexts for creating versus retrieving pies using 'get_pie' or 'get_pies'.

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