Skip to main content
Glama

IBKR TWS MCP Server

by haymant
models.py1.4 kB
from pydantic import BaseModel from typing import Optional, List, Dict, Any class ContractRequest(BaseModel): symbol: str secType: str = "STK" exchange: str = "SMART" currency: str = "USD" class HistoricalDataRequest(BaseModel): contract: ContractRequest durationStr: str = "1 Y" barSizeSetting: str = "1 day" whatToShow: str = "TRADES" useRTH: int = 1 class OrderRequest(BaseModel): contract: ContractRequest action: str # BUY or SELL totalQuantity: int orderType: str = "MKT" lmtPrice: Optional[float] = None auxPrice: Optional[float] = None transmit: bool = True class PositionModel(BaseModel): account: str contract: Dict[str, Any] position: float avgCost: float class AccountSummaryModel(BaseModel): tag: str value: str currency: str account: str class OrderStatusModel(BaseModel): orderId: int status: str filled: float remaining: float avgFillPrice: float class ExecutionModel(BaseModel): execId: str time: str acctNumber: str exchange: str side: str shares: float price: float permId: int clientId: int orderId: int liquidation: int cumQty: float avgPrice: float orderRef: Optional[str] evRule: Optional[str] evMultiplier: Optional[float] modelCode: Optional[str] lastLiquidity: Optional[int]

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/haymant/tws-mcp'

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