Skip to main content
Glama

Mastering Financial Markets

MFM bond calculator

bond_calculator
Read-onlyIdempotent

Same calculations as the fixed-income page. Supply actual dated positive cash flows including redemption, settlement, currency, and either total outlay (clean price + accrued interest + fees) or annual-effective yield as a fraction. Returns price, annual-effective ACT/365F IRR, Macaulay and modified duration, convexity, DV01, maturity and repricing scenarios. Or select one of the 10 published bond ETFs to read N-PORT exposures and reported curve risks; coupon is not yield. No quota consumed, nothing stored, no advice. Search/fetch clients: bond: settlement=2026-11-04; currency=EUR; price=100; 2027-11-04=105. ETF example: bond: etf=TLT; country=US; haircut=0.1

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "bond_calculator"
  }
}

Input Schema

NameRequiredDescriptionDefault
etfNoInstead of flows: one of the 10 published bond ETFs, to read its N-PORT exposures and reported curve risks. Accepts only country, haircut, spread_duration, spread_bps and source as other arguments.
flowsNoEvery future payment received after settlement, coupons and redemption, as {"date":"YYYY-MM-DD","amount":number ≥ 0}; up to 1,000. Example: [{"date":"2027-11-04","amount":105}].
priceNoTotal outlay in the same unit as the flows: clean price + accrued interest + fees (e.g. 101.2 for flows per 100 of nominal). Give price or yield, not both.
yieldNoAnnual-effective yield as a fraction (0.035 = 3.5%), used to compute the price. Give price or yield, not both.
sourceNoWhere the user took the cash flows or the price (prospectus, broker page); repeated in the result and not verified by MFM.
countryNoWith etf: two-letter ISO code of the government whose bonds are shocked in the sovereign scenario (required with haircut, spread_duration or spread_bps).
haircutNoWith etf and country: loss on that government's bonds as a fraction of their value, 0 to 1 (0.1 = 10%).
currencyNoISO 4217 code of the price and of every cash flow, e.g. EUR. Required with flows.
rate_bpsNoWith flows: parallel change of interest rates in basis points for the repricing scenario (100 = +1 percentage point).
fx_changeNoWith flows: exchange-rate change applied in the scenario, as a fraction greater than −1 (0.05 = +5%, −0.1 = −10%).
settlementNoSettlement (purchase) date, YYYY-MM-DD. Required with flows.
spread_bpsNoSpread change in basis points (100 = 1 percentage point): with flows for the repricing scenario; with etf and country together with spread_duration.
spread_durationNoWith etf and country, together with spread_bps: spread duration in years used for the spread scenario.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed13 schema fields changed
    • addedInput schema / properties / country / description
      Added value: +"With etf: two-letter ISO code of the government whose bonds are shocked in the sovereign scenario (required with haircut, spread_duration or spread_bps)."
    • addedInput schema / properties / currency / description
      Added value: +"ISO 4217 code of the price and of every cash flow, e.g. EUR. Required with flows."
    • addedInput schema / properties / etf / description
      Added value: +"Instead of flows: one of the 10 published bond ETFs, to read its N-PORT exposures and reported curve risks. Accepts only country, haircut, spread_duration, spread_bps and source as other arguments."
    • addedInput schema / properties / flows / description
      Added value: +"Every future payment received after settlement, coupons and redemption, as {\"date\":\"YYYY-MM-DD\",\"amount\":number ≥ 0}; up to 1,000. Example: [{\"date\":\"2027-11-04\",\"amount\":105}]."
    • addedInput schema / properties / fx_change / description
      Added value: +"With flows: exchange-rate change applied in the scenario, as a fraction greater than −1 (0.05 = +5%, −0.1 = −10%)."
    • addedInput schema / properties / haircut / description
      Added value: +"With etf and country: loss on that government's bonds as a fraction of their value, 0 to 1 (0.1 = 10%)."
    • addedInput schema / properties / price / description
      Added value: +"Total outlay in the same unit as the flows: clean price + accrued interest + fees (e.g. 101.2 for flows per 100 of nominal). Give price or yield, not both."
    • addedInput schema / properties / rate_bps / description
      Added value: +"With flows: parallel change of interest rates in basis points for the repricing scenario (100 = +1 percentage point)."
    • addedInput schema / properties / settlement / description
      Added value: +"Settlement (purchase) date, YYYY-MM-DD. Required with flows."
    • addedInput schema / properties / source / description
      Added value: +"Where the user took the cash flows or the price (prospectus, broker page); repeated in the result and not verified by MFM."
    • addedInput schema / properties / spread_bps / description
      Added value: +"Spread change in basis points (100 = 1 percentage point): with flows for the repricing scenario; with etf and country together with spread_duration."
    • addedInput schema / properties / spread_duration / description
      Added value: +"With etf and country, together with spread_bps: spread duration in years used for the spread scenario."
    • addedInput schema / properties / yield / description
      Added value: +"Annual-effective yield as a fraction (0.035 = 3.5%), used to compute the price. Give price or yield, not both."
  2. First observed

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent and non-destructive, so the bar is lower; the description still adds real context: no quota consumed, nothing stored, no advice, and the specific conventions used (annual-effective ACT/365F IRR, scenario repricing). The trailing 'bond: ...' examples explain how search/fetch clients should route here, which is behavior not visible in any structured field.

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?

The core is front-loaded: mode A, mode B, then behavioral caveats, then examples. It is dense but nearly every clause carries usable information. The final 'bond: settlement=...; currency=EUR; ...' snippet is compact to the point of being cryptic and slightly blurs tool parameters with query syntax.

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

Completeness5/5

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

With 13 parameters, no output schema, and two distinct modes, the description does the work: it enumerates the return values (price, IRR, Macaulay and modified duration, convexity, DV01, maturity, repricing scenarios) and states the constraints for each mode. An agent has enough to call it correctly without guessing.

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 the baseline is 3 and the schema already defines every parameter, including the ETF enum and the price-vs-yield exclusion. The description's added meaning ('total outlay = clean price + accrued interest + fees', yield as an annual-effective fraction, flows as positive post-settlement payments) largely restates what the schema says.

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 two concrete modes with specific inputs and outputs: price/duration math from dated cash flows, and N-PORT exposure/curve-risk lookup for one of 10 bond ETFs. It never names the closest sibling (portfolio_calculator) to draw the boundary, so an agent must infer it, but the purpose itself is unambiguous.

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?

Clear conditional routing is given: supply flows with settlement/currency plus either price or yield, 'Give price or yield, not both', or instead pick an ETF. It also warns 'coupon is not yield' and gives worked invocation examples. It stops short of saying when to prefer it over a sibling calculator that might also take holdings or returns.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources