Skip to main content
Glama
derikfernandes

BCB Payment Methods MCP Server

consultar_estabelecimentos_credenciados

Query the number of establishments authorized to accept electronic payment methods per quarter using Brazil's Central Bank data. Filter and sort results by quarter and other parameters.

Instructions

Consulta quantidade de estabelecimentos credenciados para aceitar meios de pagamento eletrônico 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)
ordenar_porNoCampo para ordenação
filtroNoFiltro OData para refinar a consulta

Implementation Reference

  • Main handler for executing the 'consultar_estabelecimentos_credenciados' tool in the MCP CallToolRequestSchema handler. Extracts parameters, calls fetchBCBData on BCB API endpoint 'EstabCredTransDA', and returns JSON-formatted data.
    case "consultar_estabelecimentos_credenciados": { const { trimestre, top = 100, ordenar_por, filtro } = args as { trimestre: string; top?: number; ordenar_por?: string; filtro?: string; }; const data = await fetchBCBData(`EstabCredTransDA(trimestre=@trimestre)?@trimestre='${trimestre}'`, { formato: "json", top, orderby: ordenar_por, filter: filtro, }); return { content: [ { type: "text", text: JSON.stringify(data, null, 2), }, ], }; }
  • Input schema definition for the 'consultar_estabelecimentos_credenciados' tool, defining parameters like trimestre (required), top, ordenar_por, and filtro.
    { name: "consultar_estabelecimentos_credenciados", description: "Consulta quantidade de estabelecimentos credenciados para aceitar meios de pagamento eletrônico 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)", }, ordenar_por: { type: "string", description: "Campo para ordenação", }, filtro: { type: "string", description: "Filtro OData para refinar a consulta", }, }, required: ["trimestre"], }, },
  • Handler for 'consultar_estabelecimentos_credenciados' tool in the HTTP server's MCP createMCPServer CallToolRequestSchema switch. Identical logic to index.ts.
    case "consultar_estabelecimentos_credenciados": { const { trimestre, top = 100, ordenar_por, filtro } = args as { trimestre: string; top?: number; ordenar_por?: string; filtro?: string; }; const data = await fetchBCBData(`EstabCredTransDA(trimestre=@trimestre)?@trimestre='${trimestre}'`, { formato: "json", top, orderby: ordenar_por, filter: filtro, }); return { content: [ { type: "text", text: JSON.stringify(data, null, 2), }, ], }; }
  • Input schema definition for the tool in http-server.ts tools array, matching index.ts.
    name: "consultar_estabelecimentos_credenciados", description: "Consulta quantidade de estabelecimentos credenciados para aceitar meios de pagamento eletrônico 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)", }, ordenar_por: { type: "string", description: "Campo para ordenação", }, filtro: { type: "string", description: "Filtro OData para refinar a consulta", }, }, required: ["trimestre"], },
  • Helper function fetchBCBData used by the tool handler to query the BCB Olinda API, building URL with OData params and fetching JSON data.
    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