Skip to main content
Glama

finance.sharpe_ratio

Read-onlyIdempotent

Calculate the Sharpe ratio from a list of periodic returns, with optional risk-free rate and annualization, to evaluate risk-adjusted investment performance.

Instructions

샤프지수 = (평균수익률 - 무위험수익률) / 표본표준편차(n-1)를 계산한다. returns 는 기간 수익률 문자열 목록(2개 이상), risk_free_rate 는 같은 기간 단위(기본 0), periods_per_year 가 0 보다 크면 sqrt(periods_per_year)를 곱해 연환산한다. 표준편차가 0 이면 오류, 결과는 소수 8자리. 연 무위험수익률을 일간 수익률에서 그대로 빼지 않는다.

Input Schema

NameRequiredDescriptionDefault
returnsYes
risk_free_rateNo0
periods_per_yearNo

Output Schema

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

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 establish that this is a read-only, idempotent, closed-world calculation, so the description adds useful extra context: it returns an error when standard deviation is zero, rounds results to eight decimal places, and warns against subtracting an annual risk-free rate directly from daily returns. It does not describe pagination or response shape, but for a pure calculator the behavioral disclosure is strong.

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 formula is front-loaded, and every sentence contributes either a parameter rule, an edge case, or an important unit warning. There is no filler.

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?

Given the 0% schema description coverage and the presence of an output schema, the description is nearly complete: it covers the formula, all three parameters, unit consistency, annualization, zero-standard-deviation failure, and output precision. The main missing piece is explicit comparison with sibling ratio tools.

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 full burden and does so well: it explains that returns is a list of period return strings requiring at least two values, that risk_free_rate is in the same period unit and defaults to 0, and that periods_per_year triggers sqrt(periods_per_year) annualization. It still leaves some ambiguity about whether return strings are decimals or percentages, so it is not perfect.

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 states a specific verb and resource: it computes the Sharpe ratio and even supplies the exact formula. It is clearly distinct in meaning from generic calculators, but it does not explicitly differentiate itself from sibling tools such as finance.sortino_ratio.

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?

The description gives practical usage constraints: returns must contain at least two period return strings, risk_free_rate must be in the same period unit, and annualization occurs when periods_per_year > 0. However, it never says when to choose this tool over alternatives like finance.sortino_ratio or the VaR tools, and it provides no explicit when-not guidance.

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