Add Stocks to Portfolio
add_portfolio_stocksAdd stocks to a portfolio, merging duplicate holdings by weighted-average price. Accepts single, bulk, or pasted broker CSV holdings.
Instructions
Add one or more stocks to the user's portfolio, merging duplicates by weighted-average price. Accepts a single add, a bulk list, or holdings the user pasted from a broker CSV/table (parse it into the holdings array yourself). Example: "Add RELIANCE 10 shares at ₹1,350" → holdings:[{symbol:"RELIANCE",quantity:10,avg_price:1350}]. STRIP exchange suffixes before calling — -EQ, -BE, -SM, -ST, -BZ, -BL, -RE, -IV, -RR, .NS, .BO — and pass plain NSE symbols (APS-SM → APS; SME stocks are supported). When the user has stated symbol, quantity and price, add them directly. When you PARSED or inferred the holdings (broker CSV, a pasted table, a screenshot), show the parsed rows for confirmation first, and ask rather than guess a missing or ambiguous field. Use search_stocks if a symbol does not resolve. Call read_me for the full broker-CSV procedure.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| holdings | Yes | Array of stocks to add (1-100 items) |