Skip to main content
Glama
enderekici

Trading 212 MCP Server

by enderekici

place_limit_order

Execute buy or sell orders at a specific price or better to control trade entry and exit points in financial markets.

Instructions

Place a limit order to buy or sell at a specified price or better

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tickerYesThe ticker symbol of the instrument
quantityYesThe quantity to buy (positive) or sell (negative)
limitPriceYesThe limit price for the order
timeValidityNoTime validity of the orderDAY

Implementation Reference

  • The handler implementation for the 'place_limit_order' tool in src/index.ts. It parses arguments using LimitOrderRequestSchema and calls the client's placeLimitOrder method.
    case 'place_limit_order': {
      const validated = LimitOrderRequestSchema.parse(args);
      const order = await client.placeLimitOrder(validated);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(order, null, 2),
          },
        ],
      };
    }
  • The API client implementation of placeLimitOrder, which performs the actual HTTP POST request to the Trading 212 API.
    async placeLimitOrder(order: LimitOrderRequest): Promise<Order> {
      return this.request(
        '/equity/orders/limit',
        {
          method: 'POST',
          body: JSON.stringify(order),
        },
        OrderSchema,
      );
    }
  • src/index.ts:177-203 (registration)
    Tool registration and schema definition for 'place_limit_order'.
      name: 'place_limit_order',
      description: 'Place a limit order to buy or sell at a specified price or better',
      inputSchema: {
        type: 'object',
        properties: {
          ticker: {
            type: 'string',
            description: 'The ticker symbol of the instrument',
          },
          quantity: {
            type: 'number',
            description: 'The quantity to buy (positive) or sell (negative)',
          },
          limitPrice: {
            type: 'number',
            description: 'The limit price for the order',
          },
          timeValidity: {
            type: 'string',
            enum: ['DAY', 'GOOD_TILL_CANCEL'],
            description: 'Time validity of the order',
            default: 'DAY',
          },
        },
        required: ['ticker', 'quantity', 'limitPrice'],
      },
    },

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