Skip to main content
Glama
enderekici

Trading 212 MCP Server

by enderekici

place_market_order

Execute immediate buy or sell orders at current market prices for specified instruments, enabling real-time trading decisions through the Trading 212 platform.

Instructions

Place a market order to buy or sell at the current market price

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tickerYesThe ticker symbol of the instrument
quantityYesThe quantity to buy (positive) or sell (negative)
extendedHoursNoAllow execution outside regular trading hours (defaults to false)

Implementation Reference

  • The actual implementation of the place_market_order tool in the client.
    async placeMarketOrder(order: MarketOrderRequest): Promise<Order> {
      return this.request(
        '/equity/orders/market',
        {
          method: 'POST',
          body: JSON.stringify(order),
        },
        OrderSchema,
      );
    }
  • The request handler for the place_market_order tool.
    case 'place_market_order': {
      const validated = MarketOrderRequestSchema.parse(args);
      const order = await client.placeMarketOrder(validated);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(order, null, 2),
          },
        ],
      };
    }
  • src/index.ts:153-175 (registration)
    Registration of the place_market_order tool definition.
    {
      name: 'place_market_order',
      description: 'Place a market order to buy or sell at the current market price',
      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)',
          },
          extendedHours: {
            type: 'boolean',
            description: 'Allow execution outside regular trading hours (defaults to false)',
            default: false,
          },
        },
        required: ['ticker', 'quantity'],
      },
    },

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