Skip to main content
Glama

PoliErgaleio

analyze_portfolio

Analyzes portfolio transactions or holdings: invested capital, value, absolute/TWR returns, eligible single-deposit CAGR, sub-portfolio allocation, and FX conversion. CAGR is null with a reason after multiple contributions or withdrawals. Use to analyze actual portfolio ledgers or current holdings and valuation data. Require real transactions/holdings and a current valuation for each holding; require FX rates where currencies differ. TWR needs a valuation immediately before each later external cash flow and at the end date; report null with its reason when absent. Equal and opposite same-day movements between sleeves in the base currency net to an internal transfer for combined TWR; confirm both legs before using that treatment. Missing acquisition cost may use the disclosed performance-from-today behavior. Never create transactions or holdings records.

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

Input Schema

NameRequiredDescriptionDefault
asOfDateNoOptional ISO date (YYYY-MM-DD) used as the CAGR end date. Defaults to today.
baseCurrencyYesReporting currency (e.g. EUR). Transactions in another currency require fxRate.
portfolioNameNoOptional label for the portfolio.
subPortfoliosYesOne entry per account, broker or strategy sleeve.

Output Schema

NameRequiredDescriptionDefault
cagrNo
seriesNo
totalGainNo
assumptionsNo
baseCurrencyNo
currentValueNo
portfolioNameNo
subPortfoliosNo
totalInvestedNo
absoluteReturnNo
firstDepositDateNo
timeWeightedReturnNo
totalInitialInvestedNo
twrUnavailableReasonNo
cagrUnavailableReasonNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedOutput schema / properties / cagrUnavailableReason
      Added value: +{
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • addedOutput schema / properties / subPortfolios / items / properties / cagrUnavailableReason
      Added value: +{
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
  2. First observed

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does substantial work: it discloses null-return semantics for CAGR and TWR with the missing-input reasons, the same-day equal-and-opposite internal-transfer netting rule, the performance-from-today fallback when acquisition cost is absent, and the read-only boundary. It omits operational context such as size/compute limits or failure modes, but the behavioral edge cases are unusually well covered.

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?

What the tool does and its inputs requirements are front-loaded, then conditional rules follow. Sentences are dense but each encodes a distinct rule (null semantics, internal transfers, acquisition-cost fallback, no writes) rather than filler. Slightly overstuffed for a single paragraph, but not wasteful.

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 nested-input analytic tool, the description covers prerequisites, currency handling, valuation requirements, null-result conditions, and the write prohibition, while an output schema already documents return values. An agent has enough to decide to call it and to assemble valid inputs without opening anything else.

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

Parameters4/5

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

Schema coverage is 100%, so baseline is 3, but the description adds cross-parameter meaning the schema cannot: FX rates only where currencies differ, TWR needing a valuation immediately before each later external cash flow, and avgCostPrice omission triggering the from-today return behavior. This meaningfully aids correct population of the nested subPortfolios structure beyond the per-field descriptions.

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

Purpose4/5

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

States a specific verb (analyzes) and resource (portfolio transactions/holdings) and enumerates the computed outputs: invested capital, value, absolute/TWR returns, CAGR, allocation, FX conversion. The scope is unambiguously analytic rather than record-creating, which separates it from sibling save/update/load tools. It does not explicitly name a sibling, keeping it just short of a 5.

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?

Gives an explicit use condition ('use to analyze actual portfolio ledgers or current holdings and valuation data') and prerequisites (real transactions/holdings, a current valuation per holding, FX rates where currencies differ). It also supplies a hard exclusion ('Never create transactions or holdings records'). It stops short of naming an alternative tool for extraction or saving cases.

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