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: {},
      },
    },
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states this is a read operation ('List'), but does not disclose behavioral traits like permissions needed, rate limits, data freshness, or error conditions. The description is minimal and lacks context beyond the basic action.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose ('List all open positions in the portfolio') and adds necessary details without waste. Every word contributes to understanding the tool's function.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (simple read operation with 0 params) and lack of annotations/output schema, the description is adequate but minimal. It covers what the tool does but lacks completeness in behavioral context, such as return format or limitations, which would be helpful for an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters with 100% schema description coverage, so no parameter information is needed. The description does not add param semantics, but this is acceptable given the lack of parameters, aligning with the baseline for 0 params.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('List all open positions') and resource ('portfolio'), with details on what data is included ('current prices, quantities, and profit/loss'). It distinguishes from siblings like get_position (single position) and get_account_info (account metadata).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for viewing portfolio holdings but does not explicitly state when to use this tool versus alternatives like get_account_summary or get_position. No exclusions or prerequisites are mentioned, leaving usage context partially inferred.

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