Skip to main content
Glama
paperinvest

Paper MCP Server

by paperinvest

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
NameRequiredDescriptionDefault
assetClassNoAsset class (default: EQUITY)
limitPriceNoLimit price (for limit orders)
portfolioIdYesPortfolio ID
quantityYesNumber of shares
sessionNoTrading session (default: REGULAR)
sideYesOrder side
stopPriceNoStop price (for stop orders)
symbolYesStock symbol
timeInForceNoTime in force (default: DAY)
typeYesOrder type

Implementation Reference

  • 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;
  • 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
      };
    });

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/paperinvest/mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server