fixed-income-mcp

v0.1.3
io.github.joselillotrax-cell/fixed-income-mcp Checked 13 hours ago Published 2 months ago

Bond pricing, duration, DV01 and convexity for AI agents, with numerical cross-checks built in.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

price_from_yield_tool Price a bond from its yield

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.

ParameterTypeDescription
coupon_rate_pct *numberAnnual coupon rate as a PERCENTAGE. Pass 4.0 for a 4% coupon, not 0.04. Zero for a zero-coupon bond.
face_value *numberRedemption amount in currency units, e.g. 1000.
issue_date *stringIssue (dated) date in ISO format, e.g. 2024-03-15.
maturity_date *stringRedemption date in ISO format, e.g. 2029-03-15.
payments_per_year *integerCoupon payments per year: 1 annual, 2 semi-annual, 4 quarterly, 12 monthly. Most government bonds pay semi-annually.
settlement_date *stringValuation date in ISO format. Must fall between issue and maturity, e.g. 2025-09-11.
ytm_pct *numberNominal annual yield to maturity as a PERCENTAGE, compounded at the coupon frequency. Pass 4.6867 for 4.6867%.
day_countstringDay-count convention used for accrual. ACT/ACT ICMA is the standard for most government and corporate bonds.

yield_from_price_tool Solve a bond's yield from its price

Solve for the yield to maturity implied by a market price. Solved by bisection, which cannot converge on a value that satisfies the iteration without solving the pricing equation. The returned checks verify the ordering of coupon, current yield and yield to maturity, which alone rules out a large class of wrong answers. This is the usual starting point: market prices are observable, yields are derived.

ParameterTypeDescription
clean_price_pct_of_face *numberQuoted clean price as a PERCENTAGE OF FACE, excluding accrued interest. Pass 97.80 for a bond quoted at 97.80%. This is not a currency amount.
coupon_rate_pct *numberAnnual coupon rate as a PERCENTAGE. Pass 4.0 for a 4% coupon, not 0.04. Zero for a zero-coupon bond.
face_value *numberRedemption amount in currency units, e.g. 1000.
issue_date *stringIssue (dated) date in ISO format, e.g. 2024-03-15.
maturity_date *stringRedemption date in ISO format, e.g. 2029-03-15.
payments_per_year *integerCoupon payments per year: 1 annual, 2 semi-annual, 4 quarterly, 12 monthly. Most government bonds pay semi-annually.
settlement_date *stringValuation date in ISO format. Must fall between issue and maturity, e.g. 2025-09-11.
day_countstringDay-count convention used for accrual. ACT/ACT ICMA is the standard for most government and corporate bonds.

bond_analytics_tool Measure interest-rate sensitivity

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.

ParameterTypeDescription
coupon_rate_pct *numberAnnual coupon rate as a PERCENTAGE. Pass 4.0 for a 4% coupon, not 0.04. Zero for a zero-coupon bond.
face_value *numberRedemption amount in currency units, e.g. 1000.
issue_date *stringIssue (dated) date in ISO format, e.g. 2024-03-15.
maturity_date *stringRedemption date in ISO format, e.g. 2029-03-15.
payments_per_year *integerCoupon payments per year: 1 annual, 2 semi-annual, 4 quarterly, 12 monthly. Most government bonds pay semi-annually.
settlement_date *stringValuation date in ISO format. Must fall between issue and maturity, e.g. 2025-09-11.
clean_price_pct_of_faceQuoted clean price as a percentage of face, e.g. 97.80. Supply either this or ytm_pct, never both.
day_countstringDay-count convention used for accrual. ACT/ACT ICMA is the standard for most government and corporate bonds.
ytm_pctNominal annual yield as a percentage, e.g. 4.6867. Supply either this or clean_price_pct_of_face, never both.

cashflow_schedule_tool List a bond's remaining cash flows

Remaining payments, with discount factors when a yield is supplied. The first flow sits a fraction of a period away rather than a whole one. That exponent is what makes an ACT/ACT ICMA yield differ from a naive one, so it is reported explicitly as periods_from_settlement.

ParameterTypeDescription
coupon_rate_pct *numberAnnual coupon rate as a PERCENTAGE. Pass 4.0 for a 4% coupon, not 0.04. Zero for a zero-coupon bond.
face_value *numberRedemption amount in currency units, e.g. 1000.
issue_date *stringIssue (dated) date in ISO format, e.g. 2024-03-15.
maturity_date *stringRedemption date in ISO format, e.g. 2029-03-15.
payments_per_year *integerCoupon payments per year: 1 annual, 2 semi-annual, 4 quarterly, 12 monthly. Most government bonds pay semi-annually.
settlement_date *stringValuation date in ISO format. Must fall between issue and maturity, e.g. 2025-09-11.
day_countstringDay-count convention used for accrual. ACT/ACT ICMA is the standard for most government and corporate bonds.
ytm_pctNominal annual yield as a percentage, e.g. 4.6867. Supply either this or clean_price_pct_of_face, never both.

scenario_shock_tool Reprice after a parallel yield shift

Compare an exact repricing against first- and second-order estimates. `residual_bp` is the genuine third-and-higher-order term. For a short bond and a 100 bp move it is a fraction of a basis point. A residual of several basis points means the duration is wrong, not that the Taylor expansion was truncated — a distinction worth making explicitly, because attributing such a gap to higher-order terms is a common and confident mistake. Supply either a price or a yield, not both.

ParameterTypeDescription
coupon_rate_pct *numberAnnual coupon rate as a PERCENTAGE. Pass 4.0 for a 4% coupon, not 0.04. Zero for a zero-coupon bond.
face_value *numberRedemption amount in currency units, e.g. 1000.
issue_date *stringIssue (dated) date in ISO format, e.g. 2024-03-15.
maturity_date *stringRedemption date in ISO format, e.g. 2029-03-15.
payments_per_year *integerCoupon payments per year: 1 annual, 2 semi-annual, 4 quarterly, 12 monthly. Most government bonds pay semi-annually.
settlement_date *stringValuation date in ISO format. Must fall between issue and maturity, e.g. 2025-09-11.
shock_bp *numberParallel shift in the yield curve, in BASIS POINTS. Positive is a rise. Pass 100 for a one-percentage-point rise.
clean_price_pct_of_faceQuoted clean price as a percentage of face, e.g. 97.80. Supply either this or ytm_pct, never both.
day_countstringDay-count convention used for accrual. ACT/ACT ICMA is the standard for most government and corporate bonds.
ytm_pctNominal annual yield as a percentage, e.g. 4.6867. Supply either this or clean_price_pct_of_face, never both.

check_consistency_tool Check a bond valuation for consistency

Test a yield someone has already produced against the required bounds. Use this to audit a figure rather than compute one — for example when checking work, or when a yield appears in a document and its plausibility matters. A bond priced below par must yield more than its coupon and more than its current yield; above par, the ordering reverses. These bounds need no iteration and reject a whole class of wrong answers immediately. The correctly solved yield is returned too, so the size of any error is visible.

ParameterTypeDescription
claimed_ytm_pct *numberThe yield to audit, as a percentage. This is the figure to be tested, not one to compute.
clean_price_pct_of_face *numberQuoted clean price as a PERCENTAGE OF FACE, excluding accrued interest. Pass 97.80 for a bond quoted at 97.80%. This is not a currency amount.
coupon_rate_pct *numberAnnual coupon rate as a PERCENTAGE. Pass 4.0 for a 4% coupon, not 0.04. Zero for a zero-coupon bond.
face_value *numberRedemption amount in currency units, e.g. 1000.
issue_date *stringIssue (dated) date in ISO format, e.g. 2024-03-15.
maturity_date *stringRedemption date in ISO format, e.g. 2029-03-15.
payments_per_year *integerCoupon payments per year: 1 annual, 2 semi-annual, 4 quarterly, 12 monthly. Most government bonds pay semi-annually.
settlement_date *stringValuation date in ISO format. Must fall between issue and maturity, e.g. 2025-09-11.
day_countstringDay-count convention used for accrual. ACT/ACT ICMA is the standard for most government and corporate bonds.