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; } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/derikfernandes/bcb-meios-pagamento-mcp_2'

If you have feedback or need assistance with the MCP directory API, please join our Discord server