Skip to main content
Glama
SidneyBissoli

Banco Central do Brasil (BCB) — SGS MCP

Cotação de câmbio (PTAX)

bcb_cambio_cotacao
Read-onlyIdempotent

Get PTAX exchange rates for a currency against BRL by day or date range. Defaults to USD and returns buy/sell rates, timestamp, and parity for non-USD.

Instructions

Consulta a cotação PTAX de uma moeda contra o real, em um dia específico ou num intervalo de datas. Padrão: dólar americano (USD). Devolve compra, venda, data/hora e tipo de boletim; para moedas não-dólar devolve também a paridade contra o USD, com a origem qualificada. Quando usar: para a cotação oficial de fechamento de um dia ou a série de um período curto. Quando NÃO usar: para a série histórica longa do dólar como série temporal do SGS use bcb_serie_valores (códigos 1 = livre venda, 3698 = PTAX venda, 3697 = PTAX compra, 3695 = PTAX média) — esta tool é a fonte primária do boletim, com compra e venda no mesmo registro; para descobrir o símbolo da moeda use bcb_cambio_moedas. Retorna: moeda, periodo (dataInicial, dataFinal, janelaPadrao), totalRegistros, cotacoes, disclaimer, qualificacaoParidade (só para moedas não-dólar), urlConsulta, consultadoEm e, quando aplicável, observacao. Sem datas, cobre os últimos 7 dias (para atravessar fim de semana e feriado). Fonte: PTAX / Cotações e boletins de câmbio do Banco Central do Brasil, via Olinda OData. A resposta repassa literalmente o disclaimer de responsabilidade do BCB, em disclaimer. Cotações existem só em dia útil com fechamento de câmbio. As paridades de moedas não-dólar vêm de agência de informação (Refinitiv), redistribuídas pelo BCB — não são apuradas pelo Banco Central.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataNoDia específico (yyyy-MM-dd ou dd/MM/yyyy). Não combine com dataInicial/dataFinal.
moedaNoSímbolo da moeda (ex.: USD, EUR, GBP, JPY). Padrão: USD.USD
limiteNoMáximo de boletins a devolver (1-1000, padrão 100)
dataFinalNoFim do intervalo (yyyy-MM-dd ou dd/MM/yyyy). Padrão: hoje.
dataInicialNoInício do intervalo (yyyy-MM-dd ou dd/MM/yyyy). Padrão: 7 dias antes do fim.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
moedaYes
periodoYes
cotacoesYes
disclaimerYesDisclaimer de responsabilidade do BCB, repassado literalmente
observacaoNo
provenanceYesUm bloco por procedência que contribuiu com esta resposta (contrato v1.1; licenças nunca se fundem)
attributionYesURLs canônicas das fontes desta resposta (lista de atribuição)
urlConsultaYes
consultadoEmYes
totalRegistrosYes
qualificacaoParidadeNoQualificação da origem das paridades não-dólar

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changedv1.15.0
    • changedOutput schema / properties / provenance / description
      Previous value: -"Um bloco por procedência que contribuiu com esta resposta (contrato v1.0; licenças nunca se fundem)"New value: +"Um bloco por procedência que contribuiu com esta resposta (contrato v1.1; licenças nunca se fundem)"
    • changedOutput schema / properties / provenance / items / description
      Previous value: -"Bloco de proveniência (contrato v1.0): fonte, URL, competência, extração e licença"New value: +"Bloco de proveniência (contrato v1.1): fonte, URL, competência, extração, diagnóstico de origem, citação e licença"
    • changedOutput schema / properties / provenance / items / properties / citation / description
      Previous value: -"Citação pronta para uso"New value: +"Citação/atribuição pronta para uso"
    • changedOutput schema / properties / provenance / items / properties / data_vintage / description
      Previous value: -"Competência do dado segundo a fonte; null quando a fonte não expõe"New value: +"Competência/vintage do dado segundo a fonte; null quando a fonte não expõe"
    • changedOutput schema / properties / provenance / items / properties / license / description
      Previous value: -"Regime legal do dado"New value: +"Regime legal do dado (id SPDX quando há, senão o nome da licença)"
    • addedOutput schema / properties / provenance / items / properties / retrieval
      Added value: +{
      +  "description": "Diagnóstico de origem da chamada: como o dado foi obtido. Medição real do servidor; unstable=true pede ao agente que trate o dado como obtido com dificuldade; null quando o servidor não mede",
      +  "oneOf": [
      +    {
      +      "additionalProperties": false,
      +      "description": "Diagnóstico de origem da chamada: como o dado foi obtido. Medição real do servidor; unstable=true pede ao agente que trate o dado como obtido com dificuldade",
      +      "properties": {
      +        "anomalies": {
      +          "description": "Anomalias superadas até o sucesso, somadas por classe, em ordem fixa; [] se nenhuma",
      +          "items": {
      +            "additionalProperties": false,
      +            "properties": {
      +              "count": {
      +                "description": "Ocorrências desta classe na chamada",
      +                "minimum": 1,
      +                "type": "integer"
      +              },
      +              "kind": {
      +                "description": "Classe da anomalia (vocabulário fechado do contrato)",
      +                "enum": [
      +                  "timeout",
      +                  "network",
      +                  "http_4xx",
      +                  "http_5xx",
      +                  "rate_limited",
      +                  "malformed_body"
      +                ],
      +                "type": "string"
      +              }
      +            },
      +            "required": [
      +              "kind",
      +              "count"
      +            ],
      +            "type": "object"
      +          },
      +          "type": "array"
      +        },
      +        "attempts": {
      +          "description": "Tentativas somadas, incluindo as repetidas (>= requests)",
      +          "minimum": 1,
      +          "type": "integer"
      +        },
      +        "requests": {
      +          "description": "Idas distintas à origem que compõem esta resposta (fatias, páginas)",
      +          "minimum": 1,
      +          "type": "integer"
      +        },
      +        "unstable": {
      +          "description": "true se houve repetição (attempts > requests) ou alguma anomalia",
      +          "type": "boolean"
      +        }
      +      },
      +      "required": [
      +        "requests",
      +        "attempts",
      +        "anomalies",
      +        "unstable"
      +      ],
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ]
      +}
    • changedOutput schema / properties / provenance / items / properties / retrieved_at / description
      Previous value: -"Instante REAL da extração na origem (ISO-8601, horário de Brasília). Resposta servida de cache mantém o instante do fetch ORIGINAL, que é a data de extração relevante."New value: +"Instante REAL da extração na origem (ISO-8601, fuso do servidor). Resposta servida de cache mantém o instante do fetch original, que é a data de extração relevante"
    • changedOutput schema / properties / provenance / items / properties / source_url / description
      Previous value: -"URL canônica que reproduz a consulta"New value: +"URL canônica que reproduz a consulta na fonte"
    • changedOutput schema / properties / provenance / items / required
      Previous value: -[
      -  "source",
      -  "source_url",
      -  "data_vintage",
      -  "retrieved_at",
      -  "citation",
      -  "license"
      -]New value: +[
      +  "source",
      +  "source_url",
      +  "data_vintage",
      +  "retrieved_at",
      +  "retrieval",
      +  "citation",
      +  "license"
      +]
  2. Changed3 schema fields changedv1.9.2
    • addedOutput schema / properties / attribution
      Added value: +{
      +  "description": "URLs canônicas das fontes desta resposta (lista de atribuição)",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / provenance
      Added value: +{
      +  "description": "Um bloco por procedência que contribuiu com esta resposta (contrato v1.0; licenças nunca se fundem)",
      +  "items": {
      +    "additionalProperties": false,
      +    "description": "Bloco de proveniência (contrato v1.0): fonte, URL, competência, extração e licença",
      +    "properties": {
      +      "citation": {
      +        "description": "Citação pronta para uso",
      +        "type": "string"
      +      },
      +      "data_vintage": {
      +        "description": "Competência do dado segundo a fonte; null quando a fonte não expõe",
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "license": {
      +        "description": "Regime legal do dado",
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "retrieved_at": {
      +        "description": "Instante REAL da extração na origem (ISO-8601, horário de Brasília). Resposta servida de cache mantém o instante do fetch ORIGINAL, que é a data de extração relevante.",
      +        "type": "string"
      +      },
      +      "source": {
      +        "description": "Fonte oficial do dado",
      +        "type": "string"
      +      },
      +      "source_url": {
      +        "description": "URL canônica que reproduz a consulta",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "source",
      +      "source_url",
      +      "data_vintage",
      +      "retrieved_at",
      +      "citation",
      +      "license"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "moeda",
      -  "periodo",
      -  "totalRegistros",
      -  "cotacoes",
      -  "disclaimer",
      -  "urlConsulta",
      -  "consultadoEm"
      -]New value: +[
      +  "moeda",
      +  "periodo",
      +  "totalRegistros",
      +  "cotacoes",
      +  "disclaimer",
      +  "urlConsulta",
      +  "consultadoEm",
      +  "provenance",
      +  "attribution"
      +]
  3. Addedv1.6.0

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint, but the description adds substantial context beyond them: unexpected 7-day default window to cross weekends/holidays, quotes exist only on business days with exchange closing, non-dollar parities come from Refinitiv (not computed by BCB), and the disclaimer is passed through literally. It also discloses the data source (Olinda OData). No contradiction with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Though long, the description is dense and logically front-loaded: core purpose first, then return structure, then usage guidance, then behavioral nuances. Every sentence earns its place — the date ranges, return fields, source, and validity constraints are all functional. No filler or repetition of schema content.

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 medium complexity (5 parameters, date/currency handling, non-dollar parity logic), the description is complete: it covers usage and exclusions, enumerates the full return structure (matching the output schema), explains data availability and provenance, and the annotations carry the safety profile. An agent has everything needed to invoke it correctly.

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 value: it explains the rationale behind the 7-day default window ('para atravessar fim de semana e feriado'), clarifies the moeda behavior (non-dollar currencies return parity), and notes that records only exist on business days — information an agent needs to interpret results. It enriches but does not replace the schema.

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 states a specific verb and resource: queries the PTAX exchange rate of a currency against the real, on a specific day or date range, with USD as default. It distinguishes itself from siblings by explicitly naming bcb_serie_valores and bcb_cambio_moedas as different tools for different jobs, so an agent can tell it apart without opening the schema.

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?

The description provides explicit 'Quando usar' and 'Quando NÃO usar' guidance, naming the exact alternative (bcb_serie_valores with specific SGS codes 1, 3698, 3697, 3695) and the reason (long time series vs. same-record buy/sell bulletin), plus bcb_cambio_moedas for symbol discovery. Nothing is left to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.