Skip to main content
Glama
joselillotrax-cell

fixed-income

Measure interest-rate sensitivity

bond_analytics_tool

Calculate bond risk metrics including Macaulay duration, modified duration, DV01, and convexity from price or yield. Validates results numerically for accurate fixed-income analysis.

Instructions

Macaulay duration, modified duration, DV01 and convexity.

Supply either a price or a yield, not both.

modified_duration_years divides Macaulay duration by one plus the PERIODIC yield. naive_modified_duration_years shows what dividing by one plus the ANNUAL yield would give — the standard error on any bond paying more than once a year. effective_duration_years is computed numerically by central differences and uses no annualisation, so it arbitrates between them. Report the modified figure; the other two are there to prove it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ytm_pctNoNominal annual yield as a percentage, e.g. 4.6867. Supply either this or clean_price_pct_of_face, never both.
day_countNoDay-count convention used for accrual. ACT/ACT ICMA is the standard for most government and corporate bonds.ACT/ACT ICMA
face_valueYesRedemption amount in currency units, e.g. 1000.
issue_dateYesIssue (dated) date in ISO format, e.g. 2024-03-15.
maturity_dateYesRedemption date in ISO format, e.g. 2029-03-15.
coupon_rate_pctYesAnnual coupon rate as a PERCENTAGE. Pass 4.0 for a 4% coupon, not 0.04. Zero for a zero-coupon bond.
settlement_dateYesValuation date in ISO format. Must fall between issue and maturity, e.g. 2025-09-11.
payments_per_yearYesCoupon payments per year: 1 annual, 2 semi-annual, 4 quarterly, 12 monthly. Most government bonds pay semi-annually.
clean_price_pct_of_faceNoQuoted clean price as a percentage of face, e.g. 97.80. Supply either this or ytm_pct, never both.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.2

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It clearly explains the computation method for effective duration (central differences, no annualization) and why naive_modified_duration_years is an error benchmark. However, it does not mention whether the tool might return errors for invalid inputs or how it handles edge cases like zero-coupon bonds, which is a minor gap. Overall, it provides strong behavioral context beyond the schema.

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 description is concise and well-structured. It front-loads the core purpose and the critical constraint (supply either price or yield), then explains the metrics in a logical flow. Every sentence adds value, and the use of backticks for field names improves readability. No wasted words.

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?

Despite having an output schema (context signals say 'Has output schema: true'), the description does not detail the return structure, but that is likely covered by the output schema. The description covers the key information needed to call the tool correctly: the input constraint, the meaning of each metric, and which one to report. It does not mention error handling or edge cases, but for a metrics tool with clear inputs and defaults, this is sufficient. A score of 4 reflects a well-rounded description.

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?

The input schema has 100% coverage, with every parameter already described in the schema (e.g., ytm_pct says 'Supply either this or clean_price_pct_of_face, never both'). The description does not add much about parameter meanings, but it does clarify the distinction between modified_duration_years and naive_modified_duration_years, which indirectly helps understand the parameters ytm_pct and payments_per_year. Since the schema already does the heavy lifting, a score of 3 is appropriate.

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 clearly states the tool's purpose: measuring interest-rate sensitivity via specific metrics (Macaulay duration, modified duration, DV01, convexity). It stands out from siblings like price_from_yield_tool or yield_from_price_tool, which focus on price/yield conversion, by specifying the domain of rate sensitivity. The metrics list is concrete and unambiguous.

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?

The description explicitly states supply either a price or a yield, not both, and clarifies why multiple duration metrics are returned, including which one to report ('Report the modified figure'). This is crucial because the input schema only has 'never both' hints on ytm_pct and clean_price_pct_of_face. It does not mention alternative tools, but that is acceptable since the tool's domain is distinct from siblings and the guidance is clear for its own usage.

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