Skip to main content
Glama

finance.sortino_ratio

Read-onlyIdempotent

Calculates the Sortino ratio from period returns and a risk-free rate, using downside deviation and optional annualization to assess risk-adjusted performance.

Instructions

소르티노 비율 = (평균수익률 - 무위험수익률) / 하방편차를 계산한다. 하방편차 = sqrt(mean(min(r - rf, 0)^2)), 평균은 전체 표본 수로 나눈다. returns 는 기간 수익률 문자열 목록(2개 이상), risk_free_rate 는 같은 기간 단위(기본 0), periods_per_year 가 0 보다 크면 연환산. 하방편차가 0 이면 오류, 결과는 소수 8자리.

Input Schema

NameRequiredDescriptionDefault
returnsYes
risk_free_rateNo0
periods_per_yearNo

Output Schema

NameRequiredDescriptionDefault
nYes
_metaNo서버가 붙이는 영수증(integrity), 엔진, 힌트
traceYes계산 근거(tool, formula, inputs, steps, output)
sortinoYes
annualizedYes
mean_excessYes
downside_devYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/closed-world, so the bar is low, and the description still adds real behavior: an error is raised when downside deviation is 0, periods_per_year > 0 triggers annualization, and the result is rounded to 8 decimals. It does not state whether the error is a tool error or a returned sentinel, but the failure mode is disclosed.

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?

Four short sentences, front-loaded with the formula, then the downside-deviation definition, then input constraints and edge cases. Nothing is redundant with the title or schema.

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

Completeness4/5

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

With an output schema present, return values need not be described, yet the description still notes 8-decimal rounding and the zero-downside-deviation error. Constraints, units and annualization are all addressed; only the numeric string format and the minimum-sample semantics remain unstated.

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 description coverage is 0%, so the description carries the load, and it covers all three parameters: returns as a list of period return strings (minimum 2), risk_free_rate in the same period unit with default 0, and periods_per_year enabling annualization when positive. It does not specify whether strings are decimals or percentages, which is the remaining ambiguity.

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 description names the exact quantity (Sortino ratio) and gives the full formula, including how downside deviation is defined, which is precisely what separates it from finance.sharpe_ratio. It never names the sibling explicitly, so differentiation relies on the agent reading the formula rather than a direct contrast.

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?

There is no explicit statement of when to use this versus finance.sharpe_ratio or finance.var_historical, and no exclusions. Usage is only implied by the formula and the '2 or more returns' precondition.

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

Deploy Server

Other Tools