create_order
Submit trading orders on the Paper platform, specifying portfolio, stock symbol, quantity, order side, type, and other parameters for execution.
Instructions
Create a new trading order
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| assetClass | No | Asset class (default: EQUITY) | |
| limitPrice | No | Limit price (for limit orders) | |
| portfolioId | Yes | Portfolio ID | |
| quantity | Yes | Number of shares | |
| session | No | Trading session (default: REGULAR) | |
| side | Yes | Order side | |
| stopPrice | No | Stop price (for stop orders) | |
| symbol | Yes | Stock symbol | |
| timeInForce | No | Time in force (default: DAY) | |
| type | Yes | Order type |
Implementation Reference
- src/index.ts:448-455 (handler)Handler logic for the 'create_order' tool. Posts order details to the '/orders' API endpoint, spreading input arguments and applying defaults for assetClass, session, and timeInForce.case 'create_order': response = await api.post('/orders', { ...args, assetClass: args.assetClass || 'EQUITY', session: args.session || 'REGULAR', timeInForce: args.timeInForce || 'DAY' }); break;
- src/index.ts:181-211 (schema)Tool definition including name, description, and detailed input schema with properties, enums, and required fields for the 'create_order' tool.name: 'create_order', description: 'Create a new trading order', inputSchema: { type: 'object', properties: { portfolioId: { type: 'string', description: 'Portfolio ID' }, symbol: { type: 'string', description: 'Stock symbol' }, quantity: { type: 'number', description: 'Number of shares' }, side: { type: 'string', enum: ['BUY_TO_OPEN', 'SELL_TO_CLOSE', 'SELL_TO_OPEN', 'BUY_TO_CLOSE'], description: 'Order side' }, type: { type: 'string', enum: ['MARKET', 'LIMIT', 'STOP', 'STOP_LIMIT'], description: 'Order type' }, timeInForce: { type: 'string', enum: ['DAY', 'GTC', 'IOC', 'FOK'], description: 'Time in force (default: DAY)' }, limitPrice: { type: 'number', description: 'Limit price (for limit orders)' }, stopPrice: { type: 'number', description: 'Stop price (for stop orders)' }, assetClass: { type: 'string', description: 'Asset class (default: EQUITY)' }, session: { type: 'string', description: 'Trading session (default: REGULAR)' } }, required: ['portfolioId', 'symbol', 'quantity', 'side', 'type'] } },
- src/index.ts:388-392 (registration)Registers all tools, including 'create_order', with the MCP server by handling ListToolsRequestSchema and returning the tools array.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });