Skip to main content
Glama

pyeconomics

Bond duration

fixed_income_duration
Read-onlyIdempotent

Macaulay and modified duration from a yield, effective and key-rate duration off a spot curve, and DV01 of a fixed-coupon bond. Runs Bond duration (fixed_income.duration, version 2) on the given inputs and returns its canonical result: the validated inputs, the outputs, the warnings and the manifest. The required calculation field selects one of: dv01, effective, key_rate, macaulay_modified. Every number carries its unit in the input schema; rates are decimals.

Input Schema

NameRequiredDescriptionDefault

No arguments

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare readOnly, idempotent, closed-world and non-destructive, so the safety profile is covered. The description adds the response envelope (validated inputs, outputs, warnings, manifest) and model provenance/version, which is modest value given an output schema exists, and it discloses nothing about failure behavior, curve interpolation, or bump semantics beyond what the schema states.

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 purpose and the four supported measures are front-loaded in the first sentence, with implementation detail after. The middle sentence listing the returned envelope is somewhat redundant against the output schema but is short and not bloated.

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?

A rich oneOf schema with 100% parameter descriptions and an output schema means the description needn't explain inputs or return values, and the description correctly defers units to the schema. What is missing is any rationale for picking one calculation mode over another, which would help an agent that only reads the 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?

Schema description coverage is 100%, so the baseline is 3. The description's note that 'every number carries its unit' and 'rates are decimals' adds a real interpretive cue (0.05, not 5), but the enumeration of the four `calculation` values merely restates the const/enum discriminator already in the schema.

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 first sentence names the specific measures (Macaulay/modified, effective, key-rate, DV01) and the resource (a fixed-coupon bond), and the second sentence names the underlying model with its version. That is enough for an agent to recognize this as the duration calculator rather than a pricing or curve-bootstrapping tool, though it never explicitly contrasts itself with the pricing sibling.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description says the required `calculation` field selects one of four modes, which implies the usage split, but it gives no guidance on when to choose `effective`/`key_rate` versus `macaulay_modified`/`dv01`, nor when to use this tool instead of fixed_income_bond_pricing. Selection is effectively left to the schema's required fields (curve inputs vs yield input).

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.