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
| Name | Required | Description | Default |
|---|---|---|---|
| ticker | Yes | The ticker symbol of the instrument | |
| quantity | Yes | The quantity to buy (positive) or sell (negative) | |
| extendedHours | No | Allow execution outside regular trading hours (defaults to false) |
Implementation Reference
- src/client.ts:167-176 (handler)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, ); } - src/index.ts:643-654 (handler)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'], }, },