Skip to main content
Glama

finance.bond_ytm

Read-onlyIdempotent

Calculates a bond's annual yield to maturity from price, face value, coupon rate, years, and payment frequency using Newton's method, and reports whether the result converged.

Instructions

채권 만기수익률(YTM)을 뉴턴법으로 구한다. price 와 face 는 양수 Decimal 문자열, coupon_rate 는 연 표면이율 소수 (예 0.05), years 는 만기 연수 정수, freq 는 연 이자지급 횟수(기본 2). ytm 은 기간 수익률 x freq 인 연율이다. 수렴하지 못하면 converged=false 로 마지막 추정값이 나오므로 확인해야 하며 이자 지급일 사이의 경과이자는 지원하지 않는다.

Input Schema

NameRequiredDescriptionDefault
tolNo1e-10
faceYes
freqNo
priceYes
yearsYes
max_iterNo
coupon_rateYes

Output Schema

NameRequiredDescriptionDefault
ytmYes
_metaNo서버가 붙이는 영수증(integrity), 엔진, 힌트
traceYes계산 근거(tool, formula, inputs, steps, output)
convergedYes
iterationsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A4.2/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/closed-world, so the description is free to add real behavioral context, and it does: the solver is Newton's method, failure to converge still returns a value flagged converged=false, and mid-period accrued interest is out of scope. These are exactly the failure-mode and scope facts an agent needs before trusting the output.

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?

Purpose is front-loaded and every sentence carries information: parameters, the ytm annualization convention, then the convergence caveat and the scope limit. The parameter explanations are packed into one long run-on clause, which slightly hurts scanability, but 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?

An output schema exists, so return values need not be explained, yet the description usefully flags the converged field as something to check. For a seven-parameter numerical solver the coverage is nearly complete; only tol and max_iter tuning behavior is left entirely to the schema.

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% — every parameter is a bare title — so the description must carry the load, and it documents five of seven: price/face as positive Decimal strings, coupon_rate as a decimal annual rate with an example (0.05), years as integer, freq as payments per year with default 2. The solver controls tol and max_iter remain undocumented in both schema and description, which is the only gap.

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 opening states a specific verb and resource — computes a bond's yield to maturity — and even names the numerical method (Newton's method). It is unambiguous what the tool produces. It does not explicitly contrast itself with the nearest sibling, finance.bond_duration, so it stops short of a 5.

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 gives a clear operational condition: check converged=false because a non-converging run still returns the last estimate. It also names an explicit exclusion — accrued interest between coupon dates is not supported — which tells the agent when not to use it. It stops short of naming alternatives for the unsupported case.

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