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, including transaction volume and value statistics for analysis.

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

  • MCP tool handler for 'consultar_transacoes_cartoes'. Extracts input parameters, fetches data from BCB's 'Quantidadeetransacoesdecartoes' OData endpoint using the shared fetchBCBData helper, and returns the JSON response as text content.
    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 definition for the 'consultar_transacoes_cartoes' tool, defining parameters including the required 'trimestre' in YYYYQ format, optional top, ordenar_por, and filtro.
    {
      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"],
      },
    },
  • MCP tool handler for 'consultar_transacoes_cartoes' in the HTTP/SSE server's createMCPServer function. Identical logic to index.ts handler.
    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 definition for the 'consultar_transacoes_cartoes' tool in http-server.ts, identical to index.ts.
    {
      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"],
      },
    },
  • Shared helper function used by all tool handlers, including 'consultar_transacoes_cartoes', to make HTTP requests to the BCB Olinda API and handle 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;
      }
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool returns data on quantity and value of card transactions, which is useful, but lacks critical details: it doesn't specify if this is a read-only operation (implied but not explicit), whether it requires authentication, any rate limits, pagination behavior (though 'top' parameter hints at it), or error conditions. For a query tool with 4 parameters, this leaves significant gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and front-loaded, stating the core purpose in the first sentence and adding return details in the second. Both sentences earn their place by clarifying scope and output. However, it could be slightly more structured by explicitly separating purpose from behavior.

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

Completeness2/5

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

Given the tool's complexity (4 parameters, no output schema, no annotations), the description is incomplete. It covers the basic query purpose and return data but misses behavioral context (e.g., safety, performance), usage guidance relative to siblings, and deeper parameter insights. For a tool with no annotations or output schema, more comprehensive description is needed to compensate.

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?

Schema description coverage is 100%, so the schema fully documents all parameters. The description adds no additional parameter semantics beyond implying the query is filtered by quarter. It doesn't explain relationships between parameters (e.g., how 'filtro' interacts with 'trimestre') or provide examples beyond what's in the schema. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Consulta estoque e transações de cartões de pagamento por trimestre' (Query stock and transactions of payment cards by quarter). It specifies the resource (payment card stock/transactions) and verb (query/consult), though it doesn't explicitly differentiate from sibling tools like 'consultar_meios_pagamento_trimestral' which might have overlapping scope.

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?

The description provides no guidance on when to use this tool versus alternatives. It mentions the quarterly timeframe but doesn't compare to monthly tools (e.g., 'consultar_meios_pagamento_mensal') or other related tools. There's no mention of prerequisites, exclusions, or typical use cases beyond the basic query scope.

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

Install Server

Other Tools

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