Skip to main content
Glama
Satsuj1n

xp-mcp

by Satsuj1n

calculate_twr

Calculate your portfolio's time-weighted return (TWR) from XPerformance import history, removing contribution and withdrawal effects to show pure investment performance.

Instructions

Time-weighted return (TWR) over the XPerformance import history. Removes the effect of when you contributed/withdrew — pure portfolio performance metric, GIPS-compliant. Uses Modified Dietz between consecutive imports and chains sub-periods geometrically. Requires ≥ 2 XPerformance imports. Returns period_return, annualized return, per-sub-period breakdown, and quality warnings (sparse history, large cash flows, stale tail).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
period_toNo
period_fromNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.12.0

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It explains the methodology (Modified Dietz between imports, geometric chaining), the requirement of ≥2 imports, and the output structure (period_return, annualized return, per-sub-period breakdown, quality warnings). This is transparent about what the tool does and what it returns. It does not mention side effects (likely none) or read-only status, but for a calculation tool this is less critical.

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

Conciseness5/5

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

The description is concise and well-structured: it leads with the core purpose, then explains the methodology, requirements, and output in a logical flow. Every sentence adds meaningful information without fluff. It is front-loaded with the key concept and avoids unnecessary details.

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?

The description covers the tool's purpose, methodology, requirements, and return values, which is substantial. However, it completely omits any explanation of the two optional parameters, which is a significant gap since the schema itself offers no descriptions. Without knowing what period_from and period_to do, an agent cannot confidently invoke the tool correctly. The lack of parameter semantics reduces overall completeness.

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

Parameters1/5

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

The input schema has two parameters (period_to, period_from) with no descriptions, and schema description coverage is 0%. The tool description does not mention these parameters at all, leaving the agent without any hint of their meaning, format, or whether they are date filters, limits, or something else. Since the description must compensate for the schema's lack of detail and it does not, this is a major gap.

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 description clearly states the tool calculates a time-weighted return over XPerformance import history, explicitly distinguishing it from money-weighted return by noting it removes the effect of contributions/withdrawals. The verb 'calculate' and resource 'time-weighted return' are specific, and the mention of GIPS compliance adds precision. It effectively differentiates itself from the sibling calculate_mwr without needing to name it explicitly.

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?

The description implies when to use this tool: when you need a pure portfolio performance metric that excludes cash-flow timing effects. It also states a hard prerequisite (≥2 XPerformance imports) that tells the agent when the tool is applicable. However, it does not explicitly name calculate_mwr as the alternative or give a direct 'use this instead of X' statement, so it is not fully explicit.

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