record_existing_position
Backfill positions you already held before onboarding, without touching ledger cash. Record units and average cost so existing holdings are counted once in your portfolio.
Instructions
Record a position the user already held before using openInvest
(onboarding backfill) WITHOUT touching ledger cash. History is marked
funding_source: external_funding, source: mcp:existing_position.
Only for positions that status does not list yet — calling it for a
symbol already there adds the units again (double count). A new purchase
paid from ledger cash is buy. Does not add the symbol to the tracked
list; use track_asset for committee coverage.
Args:
symbol: yfinance ticker (e.g. "AAPL", "510300.SS"). Gold = "GC=F", booked in
CNY per gram only (units = grams, currency "CNY", kind "metal", unit_label "克").
units: Quantity held; must be > 0.
price: Average cost per unit, in currency.
currency: Currency of price; omitted = the existing position's currency (CNY if new).
kind: Asset kind tag: "equity", "etf", "metal" (gold), "crypto", "bond", "fund", "other".
unit_label: Human display label for units (default "股", i.e. shares).
idempotency_key: Reuse the same key when retrying this exact call; recorded once.
Returns: Updated position summary, or {"status": "error", "error": ...}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | No | Asset kind tag: 'equity', 'etf', 'metal' (gold), 'crypto', 'bond', 'fund', 'other'. | equity |
| price | Yes | Average cost per unit, in `currency`. | |
| units | Yes | Quantity held; must be > 0. | |
| symbol | Yes | yfinance ticker, e.g. 'AAPL', '510300.SS'. Gold is 'GC=F' and must be booked per gram in CNY: units = grams, price = CNY/gram, currency='CNY', kind='metal', unit_label='克' (USD/oz bookings are rejected). | |
| currency | No | Currency of `price`, e.g. 'CNY', 'USD', 'AUD'. Omit to use the existing position's currency (CNY for a new position); a different currency than the position's is rejected. | |
| unit_label | No | Human display label for units (default '股', i.e. shares). | 股 |
| idempotency_key | No | Optional client-generated key (e.g. a UUID4). When retrying this SAME call after a timeout or an unknown result, reuse the same key: the ledger records it once and later calls return {"status": "duplicate"} without touching cash or holdings. Only the key is compared, not the arguments — a different order (other symbol/units/price/amount) needs a new key, or it is silently treated as the retry. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |