Skip to main content
Glama
derikfernandes

BCB Payment Methods MCP Server

consultar_transacoes_cartoes

Query quarterly payment card transaction data from Brazil's Central Bank to analyze transaction volumes and values by specific time periods.

Instructions

Consulta estoque e transações de cartões de pagamento por trimestre. Retorna dados sobre quantidade e valor das transações realizadas com cartões.

Input Schema

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

Implementation Reference

  • Handler for the 'consultar_transacoes_cartoes' tool. Extracts parameters from the request, calls fetchBCBData to query the BCB API for card transactions by trimester, and returns the JSON-formatted data.
    case "consultar_transacoes_cartoes": { const { trimestre, top = 100, ordenar_por, filtro } = args as { trimestre: string; top?: number; ordenar_por?: string; filtro?: string; }; const data = await fetchBCBData(`Quantidadeetransacoesdecartoes(trimestre=@trimestre)?@trimestre='${trimestre}'`, { formato: "json", top, orderby: ordenar_por, filter: filtro, }); return { content: [ { type: "text", text: JSON.stringify(data, null, 2), }, ], }; }
  • Input schema defining the parameters for the 'consultar_transacoes_cartoes' tool, including required 'trimestre' and optional pagination, ordering, and filtering.
    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)", }, ordenar_por: { type: "string", description: "Campo para ordenação (exemplo: 'Trimestre desc')", }, filtro: { type: "string", description: "Filtro OData para refinar a consulta", }, }, required: ["trimestre"],
  • src/index.ts:120-144 (registration)
    Tool registration in the tools array, including name, description, and schema, used by the ListToolsRequest handler.
    { name: "consultar_transacoes_cartoes", description: "Consulta estoque e transações de cartões de pagamento por trimestre. Retorna dados sobre quantidade e valor das transações realizadas com cartões.", 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)", }, ordenar_por: { type: "string", description: "Campo para ordenação (exemplo: 'Trimestre desc')", }, filtro: { type: "string", description: "Filtro OData para refinar a consulta", }, }, required: ["trimestre"], },
  • Helper function that performs the actual API call to the BCB Olinda service, building the URL with OData parameters and handling errors.
    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