Skip to main content
Glama

price_history_ranking

Read-onlyIdempotent

Ranks every bond in the active Tesouro Direto catalog by where its latest published rate sits within its own history — in ONE call. Prefer this for questions like "which bonds have rates near their historical highs?", "how does today's rate compare with the past, across the catalog?", or any cross-bond comparison of rate levels. Do NOT loop price_history_series per paper for that.

For each catalog paper and each requested window it returns rate stats for one side: min/max, nearest-rank percentiles p10/p25/p50/p75/p90 (always actually published rates), last (most recent published rate on or before to) and lastPercentile (0-100: share of the window strictly below last — 92 means the current rate is above 92% of the period, i.e. near the top of its historical range).

Inputs (all optional):

  • windows: 1-3 of '30d' | '90d' | '1y' | '5y' | 'max', default ['1y']. Ranking is ordered by the FIRST window's lastPercentile (desc); extra windows add context (e.g. ['1y','max']).

  • side: 'investorBuy' (default — investor PURCHASE rate, STN's Taxa de Compra; the standard quoted rate) or 'investorSell' (sell-back). Only papers currently available for that side are ranked.

  • productId: filter to one family. Only the six catalog families are rankable — 'selic' and 'igpm-mais-com-juros-semestrais' have history but no active catalog entries; for those use price_history_series.

  • to: anchor date YYYY-MM-DD (default today UTC) — set a past date for "how did the ranking look then?".

Output: ranking[] with productId, maturityDate, year (label year — CONVERSION year for renda-mais/educa-mais) and per-window stats; meta.missing lists catalog papers with no data in any window (e.g. just launched).

Caveats: this is a statistical description of published rates, NOT investment advice, a return forecast, or a recommendation — never present the ranking as "best bonds to buy". lastPercentile compares each paper against ITS OWN history only; a high percentile means the rate is high relative to that paper's past, nothing more. Comparing entries across families is meaningful only in that relative sense (a prefixado percentile reflects nominal rates; an ipca-mais percentile reflects real rates).

Rates are decimal fraction strings (same as price_history_series, simulate_bond, live_quotes_lookup).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toNoAnchor date YYYY-MM-DD for all windows (inclusive end). Default: today (UTC). Set a past date to ask 'how did the ranking look on that day?'.
sideNoWhich rate to rank: 'investorBuy' (default — the rate at which the investor buys from the Treasury, the standard quoted rate) or 'investorSell' (sell-back rate).
windowsNoLookback windows ending at `to` (1-3, default ['1y']): '30d' | '90d' | '1y' | '5y' | 'max' (full history). The ranking is ordered by the FIRST window; extra windows add context (e.g. ['1y','max']).
productIdNoOptional filter to a single product family. Omit to rank the whole active catalog. Only catalog families are rankable (no 'selic' / 'igpm-mais-com-juros-semestrais' — those have history but no active catalog entries).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false. The description adds rich context beyond annotations: rate stats include nearest-rank percentiles, `lastPercentile` semantics, ordering by first window, meta.missing behavior, decimal fraction string format, and caveats that this is not investment advice and only compares each paper to its own history.

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 but well-organized: purpose, usage, input parameters, output, caveats. Each section carries necessary detail for a complex tool. Slightly over-elaborate in places but no wasted sentences; front-loaded with the core purpose.

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?

Given the tool's complexity (cross-catalog ranking, multiple windows, percentiles, output schema), the description is exceptionally complete. It covers edge cases (missing data, just-launched papers), explains output structure, and clarifies cross-family comparability limits. The output schema exists, and the description supplements rather than duplicates it.

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 baseline is 3. The description adds valuable meaning: windows ordering by first window, side default and explanation, productId restrictions (only six families, selic/igpm excluded), and `to` usage with example. This goes beyond the schema but repeats some schema text.

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+scope: 'Ranks every bond in the active Tesouro Direto catalog by where its latest published rate sits within its own history — in ONE call.' It clearly distinguishes from sibling tools by explicitly naming `price_history_series` and warning not to loop it per paper.

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?

Provides explicit when-to-use: 'Prefer this for questions like...' with concrete examples, and when-not-to-use: 'Do NOT loop `price_history_series` per paper for that.' Also gives alternative directives for non-rankable families ('use `price_history_series`') and explains how to set `to` for historical rankings.

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.

TDQS

A4.6/5.0
Disambiguation4/5

Most tools have clearly distinct purposes: catalog_list for discovery, live_quotes_lookup for real-time quotes, price_history_lookup for specific-date lookups, price_history_series for time series, price_history_ranking for cross-bond comparisons, and simulate_* for simulations. The overlap among the four quote/history tools is real but mitigated by detailed descriptions clarifying when each should be used.

Naming Consistency4/5

All tool names use lowercase snake_case with descriptive words, but the pattern is slightly mixed: catalog_list, live_quotes_lookup, and price_history_* follow an object+verb structure, while simulate_bond and simulate_redemption follow a verb+object structure. Though not perfectly uniform, the naming remains predictable and readable.

Tool Count5/5

With 8 tools, the server is well-scoped for its domain—covering catalog discovery, live and historical quotes, rankings, indicators, and simulations. No tool feels redundant or extraneous, and the count is well within the ideal 3-15 range.

Completeness4/5

The tool surface covers the core lifecycle: discover bonds, fetch live/historical rates, simulate pricing, and simulate redemption with tax details. A minor gap is that indicator_history currently supports only 'selic-target' despite implying broader coverage, but this does not undermine the server's primary purpose.

Resources