place_stop_order
Execute a stop order that converts to a market order when a specified price threshold is reached, enabling automated trading decisions in Trading 212 accounts.
Instructions
Place a stop order that becomes a market order when the stop price is reached
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) | |
| stopPrice | Yes | The stop price that triggers the market order | |
| timeValidity | No | Time validity of the order | DAY |
Implementation Reference
- src/client.ts:189-198 (handler)The core client implementation for the place_stop_order tool, which sends a POST request to the /equity/orders/stop API endpoint.
async placeStopOrder(order: StopOrderRequest): Promise<Order> { return this.request( '/equity/orders/stop', { method: 'POST', body: JSON.stringify(order), }, OrderSchema, ); } - src/index.ts:669-680 (registration)The registration of the place_stop_order tool handler within the MCP server's request handler switch statement.
case 'place_stop_order': { const validated = StopOrderRequestSchema.parse(args); const order = await client.placeStopOrder(validated); return { content: [ { type: 'text', text: JSON.stringify(order, null, 2), }, ], }; }