consultar_terminais_atm
Query ATM terminal statistics by quarter from Brazil's Central Bank data to analyze self-service terminal distribution and usage patterns across regions.
Instructions
Consulta estatísticas sobre terminais de autoatendimento (ATM/caixas eletrônicos) por trimestre.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| trimestre | Yes | Ano e trimestre no formato YYYYQ (exemplo: '20234') | |
| top | No | Número máximo de registros a retornar (padrão: 100) | |
| filtro | No | Filtro OData para refinar a consulta |
Implementation Reference
- src/index.ts:219-235 (schema)Input schema defining parameters for the consultar_terminais_atm tool: trimestre (required), top, filtro.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:421-442 (handler)Handler function that executes the tool logic by querying the BCB API endpoint TerminaisATMDA for ATM terminals statistics by trimester.case "consultar_terminais_atm": { const { trimestre, top = 100, filtro } = args as { trimestre: string; top?: number; filtro?: string; }; const data = await fetchBCBData(`TerminaisATMDA(trimestre=@trimestre)?@trimestre='${trimestre}'`, { formato: "json", top, filter: filtro, }); return { content: [ { type: "text", text: JSON.stringify(data, null, 2), }, ], }; }
- src/index.ts:216-237 (registration)Tool registration in the tools list used for ListToolsRequestHandler.{ name: "consultar_terminais_atm", description: "Consulta estatísticas sobre terminais de autoatendimento (ATM/caixas eletrônicos) 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/http-server.ts:425-446 (handler)MCP handler for consultar_terminais_atm in the HTTP SSE server.case "consultar_terminais_atm": { const { trimestre, top = 100, filtro } = args as { trimestre: string; top?: number; filtro?: string; }; const data = await fetchBCBData(`TerminaisATMDA(trimestre=@trimestre)?@trimestre='${trimestre}'`, { formato: "json", top, filter: filtro, }); return { content: [ { type: "text", text: JSON.stringify(data, null, 2), }, ], }; }
- src/index.ts:37-51 (helper)Helper function to fetch data from the BCB Olinda API, used by all tools including consultar_terminais_atm.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; }