Skip to main content
Glama

Mastering Financial Markets

MFM portfolio calculator

portfolio_calculator
Read-onlyIdempotent

Run 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

NameRequiredDescriptionDefault
rowsYesThe 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.
currencyNoReference currency of all values; default the currency of the country of residence, as on the page (EUR for Italy and the euro area)
languageNoLanguage of the texts: always English (older clients that send another value also get English)
tax_rateNoTax 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
residenceYesCountry of tax residence (ISO 3166 alpha-2), as on the calculator page

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / properties / language / description
      Previous value: -"Language of the texts; default it for residence IT, otherwise en"New value: +"Language of the texts: always English (older clients that send another value also get English)"
    • changedInput schema / properties / language / enum
      Previous value: -[
      -  "it",
      -  "en"
      -]New value: +[
      +  "en"
      +]
    • addedInput schema / properties / rows / description
      Added value: +"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."
  2. First observed

TDQS

A4.3/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the read-only/idempotent annotations, the description discloses a lot of behavior: portfolios are not stored or logged, only directly held company codes count toward the 300-companies/day limit, ETF-only portfolios count nothing, ISINs go to OpenFIGI with at most 10 per request and only the ISIN is sent, unresolvable rows are reported with reasons and candidate ids rather than silently dropped, and the output is descriptive only with no advice. This is unusually complete disclosure for a mutation-free calculator.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose is front-loaded, and the detailed return-value enumeration is defensible because no output schema exists. But the description is a single sprawling paragraph densely packed with semicolons and nested parentheses; it is hard to scan, and phrases like 'as on the site' recur without adding information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex calculator with five parameters, no output schema, and significant privacy/quota implications, the description covers what the tool does, what it returns, how unresolved rows are handled, where identifiers are sent, quota accounting, and the search/fetch fallback encoding. Nothing an agent needs to invoke it correctly appears to be missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description restates the accepted security formats and gives examples ('aapl', 'US:AAPL', 'Apple', 'S&P 500', 'iShares Core MSCI World UCITS ETF'), but the schema already enumerates these forms and documents each parameter; the description adds only marginal examples, not new meaning.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The first sentence states a specific verb and resource: 'Run the MFM portfolio calculator, the same as the calculator page of the site, on positions the USER writes in the conversation.' The scope (user-supplied rows) and the concrete output sections (summary, A concentration, B currency risk, C latent tax, D crises) make it unmistakable what the tool does.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It establishes a clear usage context — positions the user writes in the conversation — and gives a concrete fallback command for clients that only expose search and fetch. However, it never explicitly says when to prefer this over a sibling such as bond_calculator or screen_companies, so the when-not guidance is absent.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources