add_portfolio_stock
Add a stock holding to your local portfolio file, merging new lots into existing positions with a quantity-weighted average price so your cost basis stays accurate.
Instructions
Add a holding to your local portfolio (~/.screener-mcp/portfolio.json).
If you already hold this symbol, the new lot merges into the existing position with a quantity-weighted average price — like a real broker ledger, buying more at a different price updates your average cost rather than overwriting it.
symbol: NSE/BSE symbol (e.g., "RELIANCE") quantity: number of shares in this lot avg_price: price per share for this lot
Examples: add_portfolio_stock("RELIANCE", quantity=10, avg_price=1350) add_portfolio_stock("TCS", quantity=5, avg_price=3800)
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"symbol": "<symbol>",
"quantity": "<quantity>",
"avg_price": "<avg_price>"
},
"name": "add_portfolio_stock"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | Yes | ||
| quantity | Yes | ||
| avg_price | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||