Skip to main content
Glama

Precio, rendimiento y duración de bono

fin-bond
Read-onlyIdempotent

Valora un bono de cupón fijo en fecha de cupón: precio a partir del rendimiento, o rendimiento al vencimiento a partir del precio (bisección), más duración de Macaulay y modificada, convexidad y rendimiento corriente. Tasas en % anual; sin intereses corridos ni convención de días. Cuándo: un cálculo de dinero, impuestos o matemática financiera tiene que ser exacto y reproducible (redondeo, centavos, tasas). No para: valorar una opción europea call y put con el modelo Black-Scholes-Merton (fin-option-price). Efectos secundarios: ninguno (solo lectura, sin red, sin estado guardado). Determinista: la misma entrada da la misma salida. Límites: entrada JSON de hasta 64 KB, 1 s por llamada, resultado de hasta 1 MB.

EN: Prices a fixed-coupon bond on a coupon date: price from yield or yield to maturity from price (bisection), plus Macaulay and modified duration, convexity and current yield. Rates in percent per year; no accrued interest or day count. [EN completo / full EN: inputSchema.description]

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "years": 2,
      "yield": 5,
      "frequency": 1,
      "coupon_rate": 5
    },
    "name": "fin-bond"
  }
}

Input Schema

NameRequiredDescriptionDefault
faceNoFace value (number; optional; default 100; min 0.01; max 1000000000000).
priceNoPrice, to compute the yield (number; optional; min 0.0001; max 10000000000000).
yearsYesYears to maturity (number; required; min 0.01; max 100).
yieldNoAnnual yield %, to compute the price (number; optional; min -50; max 200).
frequencyNoCoupons per year (optional; one of: 1, 2, 4, 12; default 2).
coupon_rateYesAnnual coupon rate % (number; required; min 0; max 100).

Output Schema

NameRequiredDescriptionDefault
priceNo
periodsNo
convexityNo
yield_percentNo
macaulay_durationNo
modified_durationNo
current_yield_percentNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "coupon_rate": 5,
      +    "frequency": 1,
      +    "years": 2,
      +    "yield": 5
      +  }
      +]
  2. Changed2 schema fields changed
    • addedInput schema / properties / coupon_rate / examples
      Added value: +[
      +  5
      +]
    • addedInput schema / properties / years / examples
      Added value: +[
      +  2
      +]
  3. Changed1 schema field changed
    • addedInput schema / description
      Added value: +"EN: Prices a fixed-coupon bond on a coupon date: price from yield or yield to maturity from price (bisection), plus Macaulay and modified duration, convexity and current yield. Rates in percent per year; no accrued interest or day count. When: a money, tax or financial-math result has to be exact and reproducible (rounding, cents, rates). Not for: pricing a European call and put with the Black-Scholes-Merton model (fin-option-price). Side effects: none (read-only, no network access, no stored state). Deterministic: the same input gives the same output. Limits: JSON input up to 64 KB, 1 s per call, result up to 1 MB."
  4. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Goes well beyond the supplied annotations: annotations already say readOnly/idempotent/non-destructive/no network, and the description adds determinism, the absence of stored state, and concrete operating limits (64 KB JSON input, 1 s per call, 1 MB result). It also discloses the numerical method (bisection) for the inverse solve and the modelling assumptions (rates in percent per year, no accrued interest, no day count), which materially affect interpreting 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?

Well front-loaded: the core computation comes first, then labelled Cuándo / No para / Efectos secundarios / Determinista / Límites blocks. Some redundancy exists — the side-effects-none and deterministic statements overlap, and the Spanish purpose is restated in an English paragraph plus a pointer to inputSchema.description, adding length without new information.

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 6-parameter, output-schema-bearing calculator this is nearly complete: inputs are fully documented in the schema, return values need not be explained, and limits, determinism and sibling exclusion are covered. The residual gap is only the price-vs-yield mutual-exclusion rule, which an agent must infer from the 'or' phrasing.

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 coverage is 100%, so the baseline is 3, but the description adds real meaning by framing yield and price as alternative inputs driving two opposite computation modes (price from yield vs YTM from price) and by restating that rates are annual percent. It still doesn't say what happens if both price and yield are supplied (precedence) or if neither is, which is the one ambiguity an agent would hit.

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?

States a specific verb and resource chain: prices a fixed-coupon bond on a coupon date, computing price from yield or YTM from price (bisection), plus Macaulay/modified duration, convexity and current yield. The scope assumption (on coupon date, no accrued interest, no day count) further pins down exactly which bond-pricing variant this is, and the explicit 'No para ... fin-option-price' makes it unmistakable against the closest sibling.

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?

Provides a 'Cuándo' condition (money, tax or financial-math results that must be exact and reproducible) and an explicit exclusion naming the alternative tool fin-option-price. The when-to-use clause is somewhat generic and would apply to nearly every fin-* sibling, so it differentiates less than the exclusion clause does, and no other alternatives (e.g. fin-tvm, fin-irr) are routed away from.

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