MFM portfolio calculator
portfolio_calculatorRun the MFM portfolio calculator, the same as the calculator page of the site, on positions the USER writes in the conversation. Returns, in order: "summary" (the page's «In short» box: {title, items:[{key, title, text, figures}], note}; composition and concentration against the MSCI World index, price paid for owner earnings against the S&P 500, earnings against the 10-year government bond, largest fall in past crises of the same type with name and years, currency exposure, latent tax; figures and comparisons only), then the page summary, A concentration looking through ETFs (HHI, equivalent companies, sectors, countries, MFM weighted X-ray of the latest reports), B currency risk, C latent tax and tax break-even fall (Italian rules for shares and ETFs when residence is IT), D the historical crises linked to the current MFM Market Weather one by one (name and years, fall in local and reference currency, amount on today's values, time under water, return needed to get back to the peak, inflation while waiting, real break-even), with the site's own sentences, formulas, declared limits and warnings. Each row: security = MFM company id (e.g. aapl), "COUNTRY:TICKER" (e.g. US:AAPL), ISIN, company name (e.g. Apple), or for an equity ETF the index it tracks or the ETF name (e.g. "S&P 500", "MSCI World", "Nasdaq-100", "Euro Stoxx 50", "FTSE All-World", "iShares Core MSCI World UCITS ETF"); current_value and book_cost (total amount paid) in the reference currency. Rows that cannot be resolved are listed with the reason (and candidate ids when several companies match) and left out; the others are computed. ISIN codes are recognised through the public OpenFIGI identifier service, as on the site (only the ISIN is sent, at most 10 per request). THE PORTFOLIO IS NOT STORED OR LOGGED: values exist only inside this request (only the codes of companies held directly are counted for the daily limit, without amounts); do not ask the user for personal data. Description only: historical and accounting figures, no forecast, no investment advice and no judgement; say so to the user. Quota: complete company pages are NOT consumed; companies held directly count toward the calculator limit of 300 companies a day per MFM account, as on the site (ETF-only portfolios count nothing). Clients that only expose search and fetch: search with "portfolio: residence=IT; currency=EUR; tax=26%; S&P 500 30000/25000; Apple 5000/1000; US:MSFT 4000/3500 USD; MSCI World 20000/18000 hedged" (each row: security value/book cost, optionally an exposure currency and "hedged"; "etf:" or "share:" before the name forces the type).
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": {
"rows": "<rows>",
"residence": "<residence>"
},
"name": "portfolio_calculator"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | Yes | The portfolio lines the user wrote in the conversation, 1 to 50: for each line the security and the amounts the user gave (current value and book cost in the reference currency). Nothing is stored and no saved portfolio is read. | |
| currency | No | Reference currency of all values; default the currency of the country of residence, as on the page (EUR for Italy and the euro area) | |
| language | No | Language of the texts: always English (older clients that send another value also get English) | |
| tax_rate | No | Tax rate on investment gains as a fraction (0.26 = 26%). Italy: 0.26 by default, as on the page. Other countries: without it the latent tax is not computed | |
| residence | Yes | Country of tax residence (ISO 3166 alpha-2), as on the calculator page |