Skip to main content
Glama
joselillotrax-cell

fixed-income

Price a bond from its yield

price_from_yield_tool

Calculate a fixed-coupon bond's clean and dirty price from a given yield to maturity, including accrued interest and day-count details. Solves bond pricing when the yield is known.

Instructions

Value a fixed-coupon bond at a given yield to maturity.

Returns clean and dirty price, accrued interest with the day counts behind it, and the consistency checks the valuation satisfies.

Use this when the yield is known and the price is wanted. For the reverse, use yield_from_price_tool.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ytm_pctYesNominal annual yield to maturity as a PERCENTAGE, compounded at the coupon frequency. Pass 4.6867 for 4.6867%.
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.

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 transparency. It discloses the return payload (clean/dirty price, accrued interest, day counts, consistency checks), which is substantive. It does not, however, mention error handling, edge cases (e.g., negative yields, settlement outside range), or assumptions, though the schema enforces some constraints. This is a minor gap but not a contradiction.

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 three sentences: purpose, outputs, and usage direction. Each sentence adds distinct value, and the most important routing information is front-loaded. There is no filler or redundancy.

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?

For a tool with eight parameters and a rich output schema, the description covers the essential context: what it computes, what it returns, and when to use it. It does not enumerate all validation rules or edge cases, but the schema and output schema cover those. It also points to the sibling tool for the inverse operation, making it functionally complete.

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 every parameter already has a detailed description (e.g., 'Pass 4.0 for a 4% coupon, not 0.04'). The tool description adds context on outputs but does not elaborate on parameters beyond what the schema provides. It correctly relies on the schema, which is sufficient, so a baseline 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 opens with 'Value a fixed-coupon bond at a given yield to maturity,' which clearly names the verb, resource, and the conditioning variable. It also enumerates the outputs (clean/dirty price, accrued interest, day counts, consistency checks) and explicitly distinguishes the reverse tool, yield_from_price_tool, so an agent can select it correctly.

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?

It explicitly states 'Use this when the yield is known and the price is wanted. For the reverse, use yield_from_price_tool.' This gives a clear usage condition and points to the alternative, leaving no ambiguity about when to invoke this tool over its siblings.

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