Skip to main content
Glama
derikfernandes

BCB Payment Methods MCP Server

consultar_taxas_intercambio

Query quarterly interchange rates from Brazil's Central Bank payment methods market to analyze transaction costs and market trends.

Instructions

Consulta taxas de intercâmbio praticadas no mercado de meios de pagamento por trimestre.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
trimestreYesAno e trimestre no formato YYYYQ (exemplo: '20234')
topNoNúmero máximo de registros a retornar (padrão: 100)
filtroNoFiltro OData para refinar a consulta

Implementation Reference

  • The handler function that executes the 'consultar_taxas_intercambio' tool by fetching interchange rates data from the BCB API using the provided trimester parameter.
    case "consultar_taxas_intercambio": {
      const { trimestre, top = 100, filtro } = args as {
        trimestre: string;
        top?: number;
        filtro?: string;
      };
    
      const data = await fetchBCBData(`TaxasIntercambioDA(trimestre=@trimestre)?@trimestre='${trimestre}'`, {
        formato: "json",
        top,
        filter: filtro,
      });
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(data, null, 2),
          },
        ],
      };
    }
  • The input schema and metadata definition for the 'consultar_taxas_intercambio' tool, including parameters like trimester, top, and filter.
    {
      name: "consultar_taxas_intercambio",
      description: "Consulta taxas de intercâmbio praticadas no mercado de meios de pagamento por trimestre.",
      inputSchema: {
        type: "object",
        properties: {
          trimestre: {
            type: "string",
            description: "Ano e trimestre no formato YYYYQ (exemplo: '20234')",
          },
          top: {
            type: "number",
            description: "Número máximo de registros a retornar (padrão: 100)",
          },
          filtro: {
            type: "string",
            description: "Filtro OData para refinar a consulta",
          },
        },
        required: ["trimestre"],
      },
    },
  • src/index.ts:263-267 (registration)
    Registration of the tools list for the ListToolsRequestSchema handler, which includes the 'consultar_taxas_intercambio' tool.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools,
      };
    });
  • Duplicate handler for 'consultar_taxas_intercambio' in the HTTP server's MCP CallToolRequestSchema.
    case "consultar_taxas_intercambio": {
      const { trimestre, top = 100, filtro } = args as {
        trimestre: string;
        top?: number;
        filtro?: string;
      };
    
      const data = await fetchBCBData(`TaxasIntercambioDA(trimestre=@trimestre)?@trimestre='${trimestre}'`, {
        formato: "json",
        top,
        filter: filtro,
      });
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(data, null, 2),
          },
        ],
      };
    }
  • Helper function used by the tool handler to fetch data from the BCB Olinda API.
    async function fetchBCBData(endpoint: string, params: QueryParams = {}) {
      try {
        const url = buildUrl(endpoint, params);
        const response = await axios.get(url, {
          headers: {
            "Accept": "application/json"
          }
        });
        return response.data;
      } catch (error) {
        if (axios.isAxiosError(error)) {
          throw new Error(`Erro ao consultar API do BCB: ${error.message}`);
        }
        throw error;
      }
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.3/5.0
Behavior2/5

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

No annotations are provided, so the description must carry the behavioral burden alone. It only signals a read-style query via 'Consulta' and the quarterly window; it does not disclose response shape, pagination, error behavior, or access requirements.

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?

The description is a single, front-loaded sentence with no filler. Every word contributes the resource, domain, and period, making it economically written.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple three-parameter query tool, the schema covers the required trimestre format and optional top/filtro. However, with no output schema or annotations, the description leaves the return payload and selection guidance unspecified, which keeps it slightly below complete.

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?

The input schema already documents all three parameters with 100% coverage. The description adds no parameter detail beyond the quarterly scope mentioned in the purpose, so the baseline of 3 is appropriate.

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 uses the specific verb 'Consulta' and names the exact resource, 'taxas de intercâmbio ... por trimestre.' This clearly distinguishes it from sibling tools like consultar_taxas_desconto and the monthly/quarterly payment-means tools.

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

Usage Guidelines2/5

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

There is no guidance about when to choose this tool over the siblings, no exclusions, and no prerequisites. The only usage signal is the quarterly scope embedded in the purpose, which is not explicit usage guidance.

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