Skip to main content
Glama

Indicadores de riesgo de rentabilidades

fin-risk-ratios
Read-onlyIdempotent

Calcula a partir de retornos periódicos (decimales, 0,01 = 1 %) el retorno anualizado (geométrico) y la volatilidad, los índices de Sharpe y Sortino frente a una tasa libre de riesgo anual, la máxima caída con su inicio y fin, y el mejor y peor periodo. Cuándo: un cálculo de dinero, impuestos o matemática financiera tiene que ser exacto y reproducible (redondeo, centavos, tasas). No para: calcular la estadística descriptiva de una lista de números (stats-describe). Efectos secundarios: ninguno (solo lectura, sin red, sin estado guardado). Determinista: la misma entrada da la misma salida. Límites: entrada JSON de hasta 64 KB, 1 s por llamada, resultado de hasta 1 MB.

EN: Computes from periodic returns (decimals, 0.01 = 1%) the annualized return (geometric) and volatility, Sharpe and Sortino ratios against an annual risk-free rate, maximum drawdown with its start and end, and best/worst period. [EN completo / full EN: inputSchema.description]

Input Schema

NameRequiredDescriptionDefault
returnsYesPeriodic returns as decimals (array of number; required; at least 2 items).
risk_free_rateNoAnnual risk-free rate % (number; optional; default 0; min -50; max 100).
periods_per_yearNoPeriods per year (252 trading days, 12 months, 52 weeks) (integer; optional; default 252; min 1; max 100000).

Output Schema

NameRequiredDescriptionDefault
periodsNo
best_periodNo
mean_returnNo
max_drawdownNo
sharpe_ratioNo
total_returnNo
worst_periodNo
sortino_ratioNo
max_drawdown_endNo
annualized_returnNo
max_drawdown_startNo
annualized_volatilityNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / returns / examples
      Added value: +[
      +  [
      +    0.1,
      +    -0.05,
      +    0.02,
      +    -0.1,
      +    0.08
      +  ]
      +]
  2. Changed1 schema field changed
    • addedInput schema / description
      Added value: +"EN: Computes from periodic returns (decimals, 0.01 = 1%) the annualized return (geometric) and volatility, Sharpe and Sortino ratios against an annual risk-free rate, maximum drawdown with its start and end, and best/worst period. When: a money, tax or financial-math result has to be exact and reproducible (rounding, cents, rates). Not for: computing descriptive statistics of a list of numbers (stats-describe). Side effects: none (read-only, no network access, no stored state). Deterministic: the same input gives the same output. Limits: JSON input up to 64 KB, 1 s per call, result up to 1 MB."
  3. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare readOnlyHint, idempotentHint, closed-world and non-destructive, and the description still adds real information beyond them: no network, no stored state, deterministic same-input/same-output, plus concrete limits (64 KB JSON input, 1 s per call, 1 MB result). Those limits are operational constraints an agent cannot get from the annotations.

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 computed outputs, then cleanly labeled sections (Cuándo / No para / Efectos / Determinista / Límites) that are easy to scan. It loses a point for the trailing artifact '[EN completo / full EN: inputSchema.description]' and the duplicated full-EN text, which adds no selection value.

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 an output schema present, the description need not explain return values, and it correctly focuses on inputs, scope, guarantees and limits. For a deterministic pure-math tool with rich annotations and 100% schema coverage, nothing an agent needs to invoke it correctly is missing.

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

Parameters3/5

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

Schema description coverage is 100%, so the baseline is 3; all three parameters are already documented in the schema with types, defaults and bounds. The description only reinforces the decimal convention (0.01 = 1%) and that the risk-free rate is annual, which the schema already states.

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 names the exact input (periodic returns as decimals) and enumerates every computed output: annualized geometric return, volatility, Sharpe, Sortino, max drawdown with start/end, best/worst period. An agent can distinguish this from stats-describe or fin-roi without opening either schema.

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

Usage Guidelines5/5

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

Explicit 'Cuándo' (financial math that must be exact/reproducible) and an explicit 'No para: calcular la estadística descriptiva de una lista de números (stats-describe)', naming the alternative and the condition that routes to it. That is the full when / when-not / alternative triad.

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