Skip to main content
Glama

price_history_lookup

Read-onlyIdempotent

Looks up historical published rates and prices for Tesouro Direto bonds on specific dates.

Accepts a bulk array of queries (up to 50). Each query: productId + referenceDate + exactly one paper identifier (maturityDate, maturityYear, or conversionYear for Renda+/Educa+). Returns official STN data for that date, or found=false.

Use when the user asks for the official published rate or unit price on a specific past date (e.g. "what was the IPCA+ 2035 rate in March 2024?").

Each result has optional investorBuy and investorSell objects with { rate, price }:

  • investorBuy — investor PURCHASE side (STN's Taxa de Compra / PU de Compra). This is the standard quoted rate.

  • investorSell — investor SELL-BACK side (STN's Taxa de Venda / PU de Venda). Normally investorSell.rate > investorBuy.rate.

found: false with unavailableReason: 'awaiting-confirmed-precision' (Selic only) does NOT mean the date has no data: STN published that session in the 2-decimal CSV but not yet in the 4-decimal file this tool requires for Selic. Do not report it to the user as missing — say the confirmed rate is not published yet, and use price_history_series for the same date at CSV precision. A found: false with no unavailableReason means no row matched the requested paper and date — the lookup is keyed by paper, so it cannot tell a market holiday from a paper STN did not offer that day.

Rates are decimal fraction strings (e.g. '0.0737' = 7.37% a.a.) — same convention as simulate_bond and live_quotes_lookup.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queriesYesList of point queries (1 to 50). Each query returns one result row or found=false.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. First observed

TDQS

A4.8/5.0
Behavior5/5

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

The annotations (readOnlyHint, idempotentHint, destructiveHint) already establish a safe read profile, and the description layers substantial behavioral context on top: the found:false semantics with unavailableReason='awaiting-confirmed-precision' (Selic only), the keyed-by-paper limitation that prevents distinguishing a holiday from a non-offered paper, the investorBuy/investorSell side conventions, and the decimal-fraction rate format. No contradiction with annotations — 'looks up' aligns with readOnlyHint=true.

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 description is long (several paragraphs) but every section earns its place: purpose, usage, investor sides, found:false edge cases, and rate format each address a distinct concern the agent needs. It is front-loaded with the core purpose before the edge-case detail. Slightly verbose relative to a two-sentence ideal, but justified by the tool's complexity.

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?

For a bulk-query tool with tricky edge cases, the description is remarkably complete: it covers batch limits, found:false behavior and its two distinct meanings, the Selic precision caveat, investor buy/sell semantics, and the rate-format convention. An output schema exists to carry return-value details, so the description need not restate them. Nothing an agent needs to call it correctly is missing.

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; the schema already documents all four fields and the exact-one-identifier constraint. The description adds value beyond that by explaining the earliest-maturityDate-wins rule for shared product+year, the investor side semantics, and the decimal-fraction rate convention, which are not inferable from the schema alone. That warrants a 4 rather than the baseline.

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 a specific verb-resource pair — 'Looks up historical published rates and prices for Tesouro Direto bonds on specific dates' — and immediately scopes it to point-in-time lookups. It distinguishes itself from siblings by emphasizing the bulk-query (up to 50) and single-date nature, and it names price_history_series and live_quotes_lookup as related tools, so an agent can tell them apart without opening schemas.

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?

Explicit when-to-use guidance is present: 'Use when the user asks for the official published rate or unit price on a specific past date', with a concrete example. It also gives when-not-to-report semantics for the Selic found:false case and routes to price_history_series for CSV-precision lookups, making the decision path clear.

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