Through Claude or another agent
Thesave_position tool takes a holding’s new total shares, not the change, and the price. Your other holdings stay as they are, and cash moves by the change in shares times the price.
Illustrative example. The figures are hypothetical, not a recommendation.
You can tell your assistant “I hold 10 shares of ALFA, priced at $181.5” and it can pass those values to the tool.
If your recorded cash can’t cover the change, the call is refused (INSUFFICIENT_CASH) until the deposit is recorded. record_cash_movement takes an idempotency_key; a retry with the same key does not record the movement twice. If you already owned your holdings, deposit their value plus any cash not yet recorded, then record each holding at the same prices.
- Close a holding: set the total to 0.
- Inverse or leveraged fund: pass
moveswithout changing the share count. Leavemovesout and the setting stays. - Option: shares are contracts times 100 and
priceis the premium per share, which becomes the mark. To change only the premium, passmark. To close an expired option, sendshares0 andprice0. Allocait changes no holding when an option expires and does not guess what it became. - Short: a negative total is a short, and works only when Allow shorts is on. It is off by default. Turn on Allow shorts in the portfolio’s settings, or set
allow_shortsonsave_portfolio.
replace_positions. A holding you leave out of the list is refused (WOULD_CLOSE_POSITIONS), not closed. To close one, include it with 0 shares and a price (a price of 0 for an expired option). For the arguments, see Holding tools.
Through the REST API
Set a holding’s new total share count with the price. A key with write access is required. Illustrative example. The figures are hypothetical, not a recommendation.- New holding: the same call opens one. Add
asset_class(a class name, alias or id), or no rule judges the holding. - Several holdings:
POST /portfolios/{id}/positions/applyreplaces them in one request. - Cash:
POST /portfolios/{id}/cash-movementsrecords a deposit or withdrawal and takes anidempotency_key(see Idempotency). moves: 1, 2, 3, -1, -2 or -3. Left out, the stored value stays. A call that changes onlymovesneeds noprice.mark: an option’s premium per share, for the Options class only. Left out, the price becomes the mark. A call that changes onlymarkneeds nopriceand moves no cash.- Symbol length: up to 21 characters, so an option symbol fits.
- Short: a negative
sharesrecords a short on a portfolio withallow_shortson, and is refused withINVALID_INPUTotherwise.
/compliance/check with your own prices to see the new status. See Prices for why you supply the price, and the API overview for the full request and response shape.
Next steps
Action log
Each change is listed and can carry a comment.
Idempotency
Make a cash movement retry safe.
Holding tools
The MCP tools that record holdings and cash.
Update holdings
The same job in the app.