Skip to main content
Glama
Portfolio Analytics MCP

Portfolio Analytics MCP

by RugSec

analyze_portfolio

Read-only

Calculate weighted ETF costs and yearly fees, then break down fund size, structure, and combined country, sector, and stock exposure for a portfolio.

Instructions

Analyse a list of ETFs: cost, fund size, structure and look-through exposure.

    Give each position as {"isin": "...", "amount": 5000}. `amount` is the
    money (any currency, used for weights and yearly cost) or a weight; give
    it for every position or for none (equal weights). Use
    `focus_countries` / `focus_sectors` (e.g. ["United States"],
    ["Technology"]) to get only those buckets. Named buckets are lower
    bounds: justETF lumps the tail into "Other".

    Args:
        positions: List of {"isin": str, "amount": number (optional)}.
        top_n: Buckets to return per breakdown when no focus is given.
        focus_countries: Only return countries containing one of these names.
        focus_sectors: Only return sectors containing one of these names.
        refresh: Bypass the 24h cache.

    Returns:
        Weighted TER and yearly fees, fund size per ETF (with small-fund
        flags), portfolio share by distribution/replication/domicile/
        currency/provider/index, and combined exposure by country, sector
        and top stocks with each ETF's contribution; or an `error`.
    

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": {
      "positions": "<positions>"
    },
    "name": "analyze_portfolio"
  }
}

Input Schema

NameRequiredDescriptionDefault
top_nNo
refreshNo
positionsYes
focus_sectorsNo
focus_countriesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations only declare readOnlyHint and openWorldHint, but the description adds substantial behavioral context: a 24h cache with a refresh bypass, an error return path, small-fund flags on fund size, and the important caveat that named buckets are lower bounds because justETF lumps the tail into 'Other'. It does not mention rate limits or data freshness beyond the cache window.

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

Conciseness4/5

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

The one-line summary is front-loaded and the Args/Returns block is scannable. It is longer than strictly necessary for an agent, and some formatting whitespace is wasted, but every clause (currency handling, equal-weight fallback, 'Other' bucket caveat) carries real 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?

With no output schema, the description takes on the return-value job and does it: weighted TER and yearly fees, per-ETF fund size, portfolio share by distribution/replication/domicile/currency/provider/index, and combined country/sector/top-stock exposure with each ETF's contribution, plus the error case. Nothing an agent needs to call or interpret it is missing.

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

Parameters5/5

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

Schema description coverage is 0% and positions is typed only as a loose object array, so the description carries the full burden — and it does: it defines the exact position shape {"isin", "amount"}, explains that amount is money (any currency) or a weight, and enforces the all-or-none weighting rule. top_n, focus_*, and refresh all get meaning beyond their bare schema titles.

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?

States a specific verb (analyse) and resource (a list of ETFs) and enumerates the four dimensions produced: cost, fund size, structure, look-through exposure. This distinguishes it from siblings like compare_etfs and analyze_portfolio_risk, which have different output framings.

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

Usage Guidelines3/5

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

It gives operational guidance ('use focus_countries/focus_sectors to get only those buckets', 'give amount for every position or for none'), but says nothing about when to pick this tool over compare_etfs or analyze_portfolio_risk. Usage is implied by the described capability rather than stated against alternatives.

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