Skip to main content
Glama

get_portfolio_returns

Read-onlyIdempotent

Calculate portfolio returns for a chosen scope and period, showing simple return, TWR, XIRR, P&L split, and NAV risk stats; add daily NAV history and drawdowns when needed.

Instructions

Portfolio return for a period: simple return, TWR and XIRR side by side, P&L split and NAV risk statistics.

Read from stored daily NAV snapshots and the ledger. include_series adds the daily NAV history of the same period with drawdown statistics. That is the dated value series; it stores nothing, and no export or snapshot is needed for it. Fetched broker rows are recorded in the local append-only ledger (no broker writes).

Input Schema

NameRequiredDescriptionDefault
scopeNoequity
periodNoYTD
detail_levelNosummary
include_seriesNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior4/5

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

With readOnly/idempotent annotations already covering the safety profile, the description still adds non-obvious behavior: nothing is persisted for the series view, no export or snapshot step is required, and no broker-side writes occur. Minor tension: it says fetched rows are recorded in a local append-only ledger, which is a state change, though the description is explicit that broker-side writes do not happen.

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?

Front-loaded with the primary output, then the optional series behavior, then the side-effect caveat. Sentences are dense but each carries information; the ledger sentence is slightly tangential but earns its place by preempting a write concern.

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

Completeness3/5

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

An output schema exists, so return values needn't be described, and the safety story is covered. What's missing is the meaning of scope and detail_level, which materially change what comes back from an otherwise adequately described tool.

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

Parameters2/5

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

Schema coverage is 0% and three of four parameters are enums with no explanation. Only include_series gets any treatment; scope (equity vs consolidated vs toss vs kis) and detail_level are left entirely unexplained, which is a substantial gap since scope in particular selects fundamentally different data.

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?

The first sentence names the resource and enumerates the concrete outputs (simple return, TWR, XIRR, P&L split, NAV risk statistics), so the purpose is unambiguous. It does not, however, differentiate itself from close siblings such as get_portfolio_summary or get_trading_pnl, which an agent must choose between.

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 states the data source (stored daily NAV snapshots plus ledger) and gives a clear condition for include_series, which is genuinely helpful. But it never says when to prefer this over get_portfolio_summary, snapshot_portfolio_nav, or get_trading_pnl, leaving sibling routing to inference.

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