Skip to main content
Glama

finance portfolio risk

finance_portfolio_risk
Read-only

Risk report for any price or return series: total return, CAGR, annualised volatility, Sharpe, Sortino, maximum drawdown and where it happened, Calmar, historical value-at-risk at 95% and 99%, expected shortfall, best and worst period and the share of positive periods; add a benchmark series for beta, alpha, correlation and tracking error. Up to 5,000 points; set periods_per_year (252 daily, 365 crypto, 52 weekly, 12 monthly). $0.003. Costs $0.003 USDC per call (x402).

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "finance_portfolio_risk"
  }
}

Input Schema

NameRequiredDescriptionDefault
pricesNooldest first
returnsNoor per-period returns as decimals
benchmarkNosame length, optional
risk_freeNo% per year
periods_per_yearNodefault 252

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4/5.0
Behavior4/5

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

Annotations only declare readOnlyHint and openWorldHint; the description adds real behavioral context beyond them: a hard 5,000-point input cap, the annualisation conventions per data frequency, and the fact that each call costs $0.003 USDC via x402 (an important payment/auth prerequisite before invoking). It does not describe error behavior, e.g. what happens if both prices and returns are omitted, or how short series are handled.

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 metric inventory is dense but front-loaded and each item earns its place; the operational constraints (point cap, period conventions, price) are grouped at the end where an agent checking feasibility will look. Minor waste: the cost is stated twice ('$0.003' then '$0.003 USDC per call (x402)').

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?

With no output schema, the description usefully enumerates the return fields, and it covers limits and pricing. It is incomplete for a tool with 5 parameters and zero required fields: nothing says that at least one of prices/returns must be supplied, whether they are mutually exclusive, or what happens on invalid or too-long input.

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 genuine meaning: periods_per_year is mapped to concrete conventions (252 daily, 365 crypto, 52 weekly, 12 monthly) beyond the schema's bare 'default 252', and it explains that supplying benchmark unlocks beta, alpha, correlation, and tracking error. The prices-vs-returns choice and risk_free units are still left to the schema alone.

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-and-resource ('Risk report for any price or return series') and enumerates the exact metrics produced (CAGR, volatility, Sharpe, Sortino, max drawdown, VaR, expected shortfall, Calmar, beta/alpha/correlation/tracking error). An agent can immediately tell this is a descriptive analytics tool distinct from the option-pricing, NPV, or position-sizing siblings.

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 implies the applicable input regime ('any price or return series') and explains how to activate benchmark-relative stats and which periods_per_year value to choose for daily/crypto/weekly/monthly data. However, there is no explicit when-to-use/when-not guidance and no reference to alternatives when a user wants forecasting or position sizing rather than historical risk statistics.

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