Skip to Content

Portfolio

Read your holdings, positions, trades and P&L reports, and convert or exit positions. Ask your AI client in plain language; it picks the tool.

get_holdings

Get account holdings with portfolio value, P&L summary, and individual positions. Use to show portfolio overview, calculate investment value, display profit/loss, and check positions before placing orders.

Example prompts

  • “Show my holdings with today’s P&L.”
  • “What is the total value of my portfolio?”

get_mutual_fund_holdings

Get mutual fund holdings with investment value, current value, and P&L summary. Use to display mutual fund portfolio, calculate mutual fund performance, track SIP investments, and analyze mutual fund returns.

Example prompts

  • “Show my mutual fund holdings and returns.”
  • “Which of my mutual funds has the highest gain?”

get_positions

Get all open and closed positions for current trading day with real-time P&L, quantities, and position details. Use to display positions, calculate profit/loss, show position sizes, monitor intraday performance, and manage risk effectively.

Example prompts

  • “Show my open positions and unrealised P&L.”
  • “Which of today’s positions are in loss?”

get_trade_book

Get all executed trades with detailed execution information, excluding pending/cancelled orders. Use to display executed trades, calculate performance statistics, track costs, generate reports, and analyze trading strategies.

Example prompts

  • “Show the trades executed today.”
  • “What was my average buy price for SBIN today?”

get_trade_history

Fetch historical trade book for a date range. Auto-paginates all records. Defaults to current financial year.

Example prompts

  • “Show my trades from last month.”
  • “List all my F&O trades this financial year.”

Parameters

ParameterTypeRequiredDescription
exchange_typestringno0=All, 1=NSE, 2=BSE, 3=MCX (default: 0)
from_datestringnoStart date in YYYY-MM-DD format (default: start of current financial year)
segment_typestringno0=All, 1=Equity, 2=Equity Derivatives, 3=Mutual Funds, 4=Currency Derivatives, 5=Commodity Derivatives (default: 0)
symbolstringnoFilter by trading symbol, e.g. NSE:SBIN-EQ (optional)
to_datestringnoEnd date in YYYY-MM-DD format (default: today)

get_realised_pnl

Fetch realised profit and loss history for a date range. Auto-paginates all records. Returns per-symbol P&L plus gross/net summary. Defaults to current financial year.

Example prompts

  • “What is my realised P&L this financial year?”
  • “Show realised P&L by symbol for the last quarter.”

Parameters

ParameterTypeRequiredDescription
exchange_typestringno0=All, 1=NSE, 2=BSE, 3=MCX (default: 0)
from_datestringnoStart date in YYYY-MM-DD format (default: start of current financial year)
segment_typestringno0=All, 1=Equity, 2=Equity Derivatives, 3=Mutual Funds, 4=Currency Derivatives, 5=Commodity Derivatives (default: 0)
symbolstringnoFor equities/MF provide ISIN (e.g. INE000A01020); for derivatives provide trading symbol (optional)
to_datestringnoEnd date in YYYY-MM-DD format (default: today)

get_tax_pnl

Fetch tax profit and loss report for a financial year. Auto-paginates all records. Returns LTCG, STCG, F&O turnover, and per-trade breakdown. Defaults to current financial year.

Example prompts

  • “Show my tax P&L report for this financial year.”
  • “What are my short-term and long-term capital gains?”

Parameters

ParameterTypeRequiredDescription
fin_yearstringnoFinancial year, e.g. 2026 (default: current financial year)
segmentstringno0=All, 1=Equity, 2=Equity Derivatives, 3=Mutual Funds, 4=Currency Derivatives, 5=Commodity Derivatives (default: 0)
transaction_typestringno0=All, 1=TRADING, 2=SHORTTERM, 3=LONGTERM, 4=Future_Book, 5=Option_Book (default: 0)

convert_position

Convert open positions from one product type to another for changing characteristics and margin requirements. Use to convert INTRADAY to CNC/delivery, MARGIN to CNC for long-term holding. Note: CNC and MTF cannot be converted.

Example prompts

  • “Convert my intraday SBIN position to delivery.”
  • “Convert 50 shares of my INFY intraday position to CNC.”

Parameters

ParameterTypeRequiredDescription
convertFromstringyesCurrent product type (INTRADAY, MARGIN) - CNC positions cannot be converted
convertQtynumberyesQuantity to convert (must be in multiples of lot size for derivatives)
convertTostringyesTarget product type (CNC, INTRADAY, MARGIN) - cannot convert to MTF
overnightnumberyesOvernight flag: 1=carry forward position, 0=today’s position
positionSidenumberyesPosition side: 1=Open long positions, -1=Open short positions
symbolstringyesPosition symbol with product type (e.g., MCX:SILVERMIC20NOVFUT-INTRADAY)

exit_positions

Close open positions and cancel pending orders for risk management and portfolio cleanup. Use to exit positions quickly, square off intraday positions, manage market volatility, and rebalance portfolios across segments.

Example prompts

  • “Exit all my open intraday positions.”
  • “Square off my NIFTY futures position and cancel its pending orders.”

Parameters

ParameterTypeRequiredDescription
exitAllnumbernoExit all positions flag: 1=exit all positions, 0=specific positions
idstringnoPosition ID(s) to exit - single position ID or comma-separated IDs (optional when using exitAll)
pendingOrdersCancelnumbernoCancel pending orders flag: 1=cancel pending orders, 0=don’t cancel
Last updated on