Skip to main content
Glama
derikfernandes

BCB Payment Methods MCP Server

consultar_portadores_cartao

Query quarterly data on payment card holders from Brazil's Central Bank (BCB) to analyze cardholder statistics and trends.

Instructions

Consulta informações sobre portadores de cartões 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

  • MCP handler for the tool: extracts trimestre, top, filtro parameters and fetches data from BCB's PortadoresCartaoDA API endpoint, returning formatted JSON response.
    case "consultar_portadores_cartao": {
      const { trimestre, top = 100, filtro } = args as {
        trimestre: string;
        top?: number;
        filtro?: string;
      };
    
      const data = await fetchBCBData(`PortadoresCartaoDA(trimestre=@trimestre)?@trimestre='${trimestre}'`, {
        formato: "json",
        top,
        filter: filtro,
      });
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(data, null, 2),
          },
        ],
      };
    }
  • Input schema definition for the tool, specifying required 'trimestre' parameter and optional top and filtro.
      {
        name: "consultar_portadores_cartao",
        description: "Consulta informações sobre portadores de cartões 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)
    Registers the list of tools (including consultar_portadores_cartao) for MCP listTools requests.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools,
      };
    });
  • Duplicate MCP handler implementation in the HTTP server module for the tool.
    case "consultar_portadores_cartao": {
      const { trimestre, top = 100, filtro } = args as {
        trimestre: string;
        top?: number;
        filtro?: string;
      };
    
      const data = await fetchBCBData(`PortadoresCartaoDA(trimestre=@trimestre)?@trimestre='${trimestre}'`, {
        formato: "json",
        top,
        filter: filtro,
      });
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(data, null, 2),
          },
        ],
      };
    }
  • Helper function to fetch data from BCB Olinda API, used by all tool handlers including consultar_portadores_cartao.
    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?

No annotations are provided, so the description carries the full burden. It states it's a query operation ('Consulta'), implying read-only behavior, but doesn't disclose authentication needs, rate limits, pagination (beyond the 'top' parameter hint), error handling, or what the return data looks like (e.g., structure, fields). For a query tool with no annotation coverage, this is a significant gap in behavioral context.

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

Conciseness5/5

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

The description is a single, efficient sentence in Portuguese that front-loads the core purpose ('Consulta informações sobre portadores de cartões de pagamento por trimestre'). It has zero waste, with every word contributing to the tool's intent and scope.

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 no annotations, no output schema, and a query tool with three parameters, the description is incomplete. It lacks details on behavioral traits (e.g., safety, performance), output format, and usage context relative to siblings. While concise, it doesn't provide enough context for an agent to fully understand how and when to invoke this tool effectively.

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%, with clear descriptions for all three parameters (trimestre, top, filtro). The description adds no additional parameter semantics beyond what's in the schema, such as explaining the 'filtro' OData syntax or default behaviors. Baseline score of 3 is appropriate as 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 verb 'Consulta' (query/consult) and the resource 'informações sobre portadores de cartões de pagamento' (information about payment card holders), specifying the temporal scope 'por trimestre' (by quarter). It distinguishes from some siblings like consultar_estabelecimentos_credenciados (query accredited establishments) but not from consultar_transacoes_cartoes (query card transactions), which might overlap in data domain.

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?

No explicit guidance on when to use this tool versus alternatives is provided. The description mentions 'por trimestre' (by quarter), which might imply usage for quarterly data, but it doesn't specify contexts, exclusions, or compare to siblings like consultar_meios_pagamento_trimestral (query quarterly payment methods) or consultar_transacoes_cartoes (query card transactions).

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