Tool References
OpenAlgo MCP β Tool Reference & Prompt Examples
Companion reference to the main MCP setup guide. Once the MCP server is wired into Claude Desktop, Cursor, Windsurf, Antigravity, or any other MCP-capable client, you can ask for these operations in plain English β the client decides which tool to call.
All 40 tools shipped by the server are listed below with:
What the tool does
Key parameters (required / optional)
Example prompts you can paste directly into Claude / Cursor / Antigravity / Windsurf
Conventions
Default strategy tag:
python mcpβ every MCP-triggered order is tagged so you can filter MCP activity in OpenAlgo logs and the Analyzer. Override by saying "use strategy 'my scalper'" in the prompt.Product type defaults:
MISfor equity. UseNRMLfor F&O carry;CNCfor delivery.Exchange codes:
NSE,BSE,NFO,BFO,CDS,BCD,MCX+NSE_INDEX/BSE_INDEXfor index values.Lot size: never hardcoded. The model will call
get_option_symbol/get_option_chain/get_symbol_infoto read the livelotsizefrom the broker master contract, then computequantity = lots Γ lotsizefor you.
π¦ Order Management
place_order
place_orderPlace a single market / limit / stop-loss order.
symbol, quantity, action
Yes
β
exchange
No
Default NSE
price_type
No
MARKET, LIMIT, SL, SL-M. Default MARKET
product
No
CNC, NRML, MIS. Default MIS
strategy
No
Default python mcp
price, trigger_price, disclosed_quantity
No
Use as applicable
Prompts:
"Place a market buy for 100 shares of RELIANCE on NSE, intraday"
"Buy 50 INFY at limit 1550, delivery product"
"Sell 25 SBIN with a stop-loss at 765 and trigger 766"
place_smart_order
place_smart_orderAuto-calculates the delta between your current position and the target position_size, then sends only the incremental order.
symbol, quantity, action, position_size
Yes
position_size = your target net qty
Rest
No
Same defaults as place_order
Prompts:
"Square off my TATAMOTORS intraday position to zero"
"Scale my YESBANK position to 100 shares long"
place_basket_order
place_basket_orderFire multiple orders in one call. Each basket entry carries its own symbol, exchange, action, quantity, pricetype, product.
Prompts:
"Place a basket: buy 1 BHEL and sell 1 ZOMATO, both market MIS on NSE"
"Build a basket of SBIN, HDFCBANK and ICICIBANK buys, 10 shares each, CNC"
place_split_order
place_split_orderBreak a large order into equal chunks (helpful for low-liquidity names or to avoid freeze limits).
Prompts:
"Sell 500 YESBANK in slices of 50, market orders"
"Split 1200 NIFTY lots across 100-lot chunks"
place_options_order
place_options_orderSingle-leg option order using offset-based strike selection (ATM / ITM1βITM50 / OTM1βOTM50). The server resolves the strike against the live option chain.
underlying, exchange, offset, option_type, action, quantity
Yes
β
expiry_date
No
Optional if underlying includes expiry (e.g., NIFTY28OCT25FUT)
price_type, product, price, trigger_price
No
Same as place_order
Lot size note: if you don't know it, just ask β the assistant will pull
lotsizefromget_option_symbolfirst, then size the quantity correctly.
Prompts:
"Buy 1 lot NIFTY ATM CE expiring 28NOV25"
"Short 2 lots BANKNIFTY OTM3 PE for next weekly expiry"
place_options_multi_order
place_options_multi_orderMulti-leg option strategies (up to 20 legs). BUY legs are fired first for margin efficiency, then SELL legs. Supports per-leg overrides for expiry_date, pricetype, price, product, etc. β perfect for calendar / diagonal spreads.
Prompts:
"Place an iron condor on NIFTY 28NOV25 at OTM5 and OTM10 strikes, 1 lot each, NRML"
"Build a long straddle on BANKNIFTY ATM for 25NOV25 expiry with limit orders at 250"
"Diagonal NIFTY spread: buy ITM2 CE 30DEC25, sell OTM2 CE 25NOV25, 1 lot"
modify_order
modify_orderChange price / quantity / type / trigger on a working order.
order_id, symbol, action, exchange, product, quantity, price
Yes
price is mandatory per the REST spec β use current price if unchanged
price_type, trigger_price, disclosed_quantity
No
Sensible defaults
Prompts:
"Modify order 250408001002736 β change limit price to 16.5"
"Increase quantity of my open NIFTY CE buy order to 2 lots"
cancel_order
cancel_orderPrompt: "Cancel order 250408001002736"
cancel_all_orders
cancel_all_ordersPrompts:
"Cancel every pending order I have"
"Kill all open orders for strategy 'nifty scalper'"
π Positions & Holdings
close_all_positions
close_all_positionsSquare off everything for a strategy.
Prompt: "Close all my open positions now"
get_open_position
get_open_positionQuery the current net quantity for a specific instrument.
Prompts:
"What's my current position in NHPC NSE MIS?"
"How many NIFTY futures am I long?"
get_position_book
get_position_bookEvery open position across instruments.
Prompt: "Show me all open positions with unrealized P&L"
get_holdings
get_holdingsDelivery/CNC holdings with today's P&L, % move, and aggregate statistics.
Prompts:
"Show my demat holdings sorted by today's % change"
"What's the total unrealized P&L on my long-term portfolio?"
get_funds
get_fundsCash, collateral, realized/unrealized M2M, utilized margin.
Prompt: "How much free cash do I have for trading today?"
π Order Tracking
get_order_status
get_order_statusPrompt: "Check status of order 250828000185002 β did it fill?"
get_order_book
get_order_bookEvery order today with statistics (open / complete / cancelled / rejected counts).
Prompts:
"Show today's order book"
"How many of my orders got rejected today and why?"
get_trade_book
get_trade_bookOnly executed fills.
Prompt: "List all my executed trades today with average price"
π Market Data
get_quote
get_quoteLTP, bid, ask, OHLC, volume for one symbol.
Prompts:
"Get the latest quote for RELIANCE"
"What's NIFTY trading at right now?"
get_multi_quotes
get_multi_quotesQuotes for many symbols in one round-trip.
Prompt: "Get quotes for RELIANCE, TCS, INFY, HDFCBANK and ICICIBANK"
get_market_depth
get_market_depthFull 5-level bid/ask book plus total buy/sell qty and OI.
Prompt: "Show the order book depth for SBIN"
get_historical_data
get_historical_dataOHLCV history. Two sources:
source="api"(default) β live fetch from broker APIsource="db"β local Historify DuckDB store (1m and D stored physically; other intervals, including custom ones like 2m/3m/W/M/Q/Y, computed on-the-fly via SQL)
Prompts:
"Get 5-minute SBIN candles from 1 Apr to 8 Apr 2025"
"Pull NIFTY daily data for the last 6 months from the local Historify DB"
"Give me weekly aggregates of BANKNIFTY for the past year using source=db"
get_option_chain
get_option_chainReal-time chain with CE/PE data per strike β LTP, bid/ask, OHLC, volume, OI, lotsize, moneyness labels. Use strike_count=N to limit to N strikes around ATM.
Prompts:
"Show me NIFTY option chain for 30DEC25, 10 strikes around ATM"
"Full BANKNIFTY option chain for this week's expiry"
π Instrument Search & Symbols
search_instruments
search_instrumentsFuzzy search across exchanges by name or symbol.
Prompts:
"Search for NIFTY 26000 Dec CE"
"Find all TATA stocks on NSE"
get_symbol_info
get_symbol_infoFull metadata for one symbol: brsymbol, lotsize, expiry, strike, tick_size, token.
Prompts:
"Get symbol info for NIFTY30DEC25FUT on NFO"
"What's the lot size for BANKNIFTY futures?"
get_option_symbol
get_option_symbolResolve ATM/ITM/OTM offset to the exact option symbol plus lotsize, tick_size, underlying_ltp. Expiry optional if the underlying includes one.
Prompts:
"Get the ATM CE symbol for NIFTY expiring 28OCT25"
"What's the OTM4 PE for BANKNIFTY next weekly?"
get_option_greeks
get_option_greeksDelta, Gamma, Theta, Vega, Rho + Implied Volatility using Black-76. Underlying is auto-detected β override with underlying_symbol / underlying_exchange, supply forward_price for custom / illiquid underlyings, and expiry_time for non-standard MCX contracts.
Prompts:
"Calculate greeks for NIFTY25NOV2526000CE with 6.5% interest rate"
"What's the delta and IV of the ATM NIFTY CE for 28NOV25?"
get_synthetic_future
get_synthetic_futurePut-call parity synthetic future price β useful for illiquid futures or weekly expiries that lack a traded future.
Prompt: "What's the NIFTY synthetic future price for 25NOV25?"
get_expiry_dates
get_expiry_datesAll tradeable expiries for an underlying.
Prompt: "List all NIFTY options expiries available on NFO"
get_available_intervals
get_available_intervalsSupported timeframes for get_historical_data.
Prompt: "What intraday intervals are supported?"
get_instruments
get_instrumentsBulk instrument master download for an exchange (or all exchanges when exchange is omitted). Output is paginated β default limit 500, with a truncated flag.
Prompts:
"Download the NFO instrument master, first 500 rows"
"Get all MCX instruments available for trading"
get_index_symbols
get_index_symbolsReturns the full standardized OpenAlgo index symbol list (57 NSE + 40 BSE), rolled out uniformly across every supported broker.
Prompts:
"List all NSE index symbols I can subscribe to"
"Show me the BSE index list β I want to stream SENSEX50"
π° Margin
calculate_margin
calculate_marginSPAN + exposure margin for a hypothetical position set. Accepts an array of legs with symbol, exchange, action, product, pricetype, quantity.
Prompts:
"Calculate margin for 1 lot NIFTY 25000 CE buy + 1 lot 25500 CE sell, 25NOV25 expiry"
"How much margin do I need for a BANKNIFTY short straddle at ATM for next week?"
π§ͺ Analyzer
analyzer_status
analyzer_statusAm I in simulated (analyzer) or live mode?
Prompt: "Am I in live or analyzer mode right now?"
analyzer_toggle
analyzer_toggleFlip between simulated and live trading. Analyzer mode returns SB-xxx pseudo-orderids without touching the broker β perfect for testing strategies end-to-end.
Prompts:
"Switch to analyzer mode before I test this strategy"
"Turn off analyzer β I want to go live"
π
Market Calendar
get_holidays
get_holidaysFull holiday list for a year (year optional β defaults to current year).
Prompts:
"What are the trading holidays in 2026?"
"List this year's market holidays"
get_timings
get_timingsExchange open/close epoch timestamps for a given date (date optional β defaults to today).
Prompt: "What are today's market timings across NSE, BFO and MCX?"
check_holiday
check_holidayQuick pre-trade check: is a given date a holiday on a specific exchange?
Prompts:
"Is 26 Jan 2026 a holiday on NSE?"
"Is tomorrow a trading day on MCX?"
π οΈ Utilities
get_openalgo_version
get_openalgo_versionPrompt: "What version of the openalgo library is running?"
validate_order_constants
validate_order_constantsQuick cheat-sheet of valid exchanges, product types, price types, actions, and intervals β useful when the model wants to double-check a parameter before sending an order.
Prompt: "Remind me of the valid product types and price types"
send_telegram_alert
send_telegram_alertPush a Telegram notification via the OpenAlgo Telegram bot (must be configured in OpenAlgo settings first). Supports priority 1β10.
Prompts:
"Send me a Telegram alert: NIFTY crossed 26000, priority 8"
"Ping me on Telegram if my NIFTY CE fills"
π§ Worked Multi-Tool Workflows
Real strength shows when the assistant chains tools on its own. Example prompts:
1. End-to-end iron condor (analyzer mode):
"Set up a NIFTY iron condor for next week's expiry. Find the expiry, pull the option chain, use OTM5 strikes on both sides, calculate the margin required, and β only if margin is under βΉ1L β place it in analyzer mode using 1 lot per leg."
The assistant will chain: get_expiry_dates β get_option_chain β get_option_symbol (for lot size) β calculate_margin β analyzer_status / analyzer_toggle β place_options_multi_order.
2. Pre-market checklist:
"Before I start trading: is the market open today on NSE and MCX, what's my free cash, what's my current position book, and what's NIFTY spot right now?"
Chains: check_holiday β get_timings β get_funds β get_position_book β get_quote.
3. Options greeks scan:
"Pull the NIFTY option chain for 25NOV25 within 5 strikes of ATM, then compute greeks for the ATM CE and PE with 6.5% interest rate β tell me which has higher vega."
Chains: get_option_chain β get_option_symbol (ATM) Γ 2 β get_option_greeks Γ 2.
4. Square-off with Telegram confirmation:
"Square off everything, cancel all pending orders, then send me a Telegram alert summarizing what got closed with the realized P&L."
Chains: cancel_all_orders β close_all_positions β get_trade_book β send_telegram_alert.
Quick Prompt Patterns
Status check
"What's my {thing}?"
Single action
"{Buy/Sell} {qty} {symbol} at {price}"
Multi-leg
"Build a {strategy} on {underlying} {expiry} with {offsets}"
Safety-first
"In analyzer mode, {do the thing}"
Conditional
"Only if {condition}, then {action}"
Research
"Show me {chain/greeks/history} and recommend {levels}"
Safety Tips
Start in analyzer mode (
analyzer_toggle True) while you get comfortable β orders look real but never leave OpenAlgo.Use phrases like "only if margin is under X" or "ask me to confirm before placing" β the assistant will pause for your OK.
Use a unique
strategyname per use-case (e.g., "use strategy 'nifty scalper'") so MCP-driven activity is cleanly separable from manual orders in logs.For live trading, set up the OpenAlgo Telegram bot and ask the assistant to "send a Telegram alert after every order fill" β you get a realtime feed without staring at the screen.
Related
MCP Server Setup Guide β install, configure Claude / Cursor / Windsurf, broker prerequisites
OpenAlgo Symbol Format β how equity / future / option symbols are constructed
API Documentation β underlying REST endpoints each MCP tool wraps
Last updated