Skip to main content
Glama
derikfernandes

BCB Payment Methods MCP Server

consultar_meios_pagamento_mensal

Query monthly payment method data from Brazil's Central Bank, including PIX, bank slips, TED, DOC, and card transactions. Specify year-month to retrieve statistics for analysis.

Instructions

Consulta dados mensais sobre meios de pagamento, incluindo operações com boletos bancários, PIX, TED, DOC e outros. Use o formato YYYYMM para o parâmetro ano_mes (exemplo: '202312' para dezembro de 2023).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ano_mesYesAno e mês no formato YYYYMM (exemplo: '202312')
topNoNúmero máximo de registros a retornar (padrão: 100)
skipNoNúmero de registros a pular para paginação
filtroNoFiltro OData para refinar a consulta (exemplo: "Modalidade eq 'PIX'")

Implementation Reference

  • Core handler logic for executing the 'consultar_meios_pagamento_mensal' tool. Parses input arguments, calls fetchBCBData with the specific OData endpoint for monthly payment methods, and returns the JSON-formatted API response.
    case "consultar_meios_pagamento_mensal": {
      const { ano_mes, top = 100, skip, filtro } = args as {
        ano_mes: string;
        top?: number;
        skip?: number;
        filtro?: string;
      };
    
      const data = await fetchBCBData(`MeiosdePagamentosMensalDA(AnoMes=@AnoMes)?@AnoMes='${ano_mes}'`, {
        formato: "json",
        top,
        skip,
        filter: filtro,
      });
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(data, null, 2),
          },
        ],
      };
    }
  • Input schema definition for the tool, specifying required 'ano_mes' parameter in YYYYMM format and optional pagination/filter parameters.
    {
      name: "consultar_meios_pagamento_mensal",
      description: "Consulta dados mensais sobre meios de pagamento, incluindo operações com boletos bancários, PIX, TED, DOC e outros. Use o formato YYYYMM para o parâmetro ano_mes (exemplo: '202312' para dezembro de 2023).",
      inputSchema: {
        type: "object",
        properties: {
          ano_mes: {
            type: "string",
            description: "Ano e mês no formato YYYYMM (exemplo: '202312')",
          },
          top: {
            type: "number",
            description: "Número máximo de registros a retornar (padrão: 100)",
          },
          skip: {
            type: "number",
            description: "Número de registros a pular para paginação",
          },
          filtro: {
            type: "string",
            description: "Filtro OData para refinar a consulta (exemplo: \"Modalidade eq 'PIX'\")",
          },
        },
        required: ["ano_mes"],
      },
  • MCP server handler for 'consultar_meios_pagamento_mensal' tool execution, identical logic to stdio version.
    case "consultar_meios_pagamento_mensal": {
      const { ano_mes, top = 100, skip, filtro } = args as {
        ano_mes: string;
        top?: number;
        skip?: number;
        filtro?: string;
      };
    
      const data = await fetchBCBData(`MeiosdePagamentosMensalDA(AnoMes=@AnoMes)?@AnoMes='${ano_mes}'`, {
        formato: "json",
        top,
        skip,
        filter: filtro,
      });
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(data, null, 2),
          },
        ],
      };
    }
  • Input schema definition for the tool in HTTP server version, identical to stdio server.
    {
      name: "consultar_meios_pagamento_mensal",
      description: "Consulta dados mensais sobre meios de pagamento, incluindo operações com boletos bancários, PIX, TED, DOC e outros. Use o formato YYYYMM para o parâmetro ano_mes (exemplo: '202312' para dezembro de 2023).",
      inputSchema: {
        type: "object",
        properties: {
          ano_mes: {
            type: "string",
            description: "Ano e mês no formato YYYYMM (exemplo: '202312')",
          },
          top: {
            type: "number",
            description: "Número máximo de registros a retornar (padrão: 100)",
          },
          skip: {
            type: "number",
            description: "Número de registros a pular para paginação",
          },
          filtro: {
            type: "string",
            description: "Filtro OData para refinar a consulta (exemplo: \"Modalidade eq 'PIX'\")",
          },
        },
        required: ["ano_mes"],
      },
    },
  • Shared helper function to perform API requests to the BCB Olinda service, handling URL building, axios GET, and error wrapping. Used by all tool handlers.
    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 full burden for behavioral disclosure. It describes a query operation ('Consulta') which implies read-only behavior, but doesn't explicitly state whether it's safe, whether it requires authentication, rate limits, or what happens with large datasets. The description mentions pagination parameters (top, skip) but doesn't explain pagination behavior or default values beyond what's in the schema. For a tool with 4 parameters and no annotation coverage, this is inadequate.

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 efficiently structured in two sentences: the first states the purpose and scope, the second provides crucial parameter formatting guidance. Every word earns its place, with no redundant information. It's appropriately sized for a query tool with good schema documentation.

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

Completeness3/5

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

Given 4 parameters with 100% schema coverage but no annotations and no output schema, the description does an adequate but minimal job. It clarifies the monthly focus and parameter format, which helps contextualize the tool. However, for a data query tool with pagination and filtering capabilities, the description should ideally mention something about the return format, data volume considerations, or typical use cases to compensate for the lack of output schema and annotations.

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 already documents all parameters thoroughly. The description adds value by providing a concrete example of the 'ano_mes' parameter format ('YYYYMM' with '202312' example), which clarifies the expected syntax beyond the schema's similar description. However, it doesn't add meaningful context about the other parameters (top, skip, filtro) beyond what's already in their schema descriptions.

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 action ('Consulta' - query/consult) and the resource ('dados mensais sobre meios de pagamento' - monthly data about payment methods), with specific examples of what's included (boletos bancários, PIX, TED, DOC e outros). It distinguishes from sibling 'consultar_meios_pagamento_trimestral' by specifying 'mensais' (monthly) rather than quarterly, though doesn't explicitly contrast with other siblings like transaction or terminal queries.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context through the parameter format example (YYYYMM for monthly data) and by specifying it's for 'dados mensais' (monthly data), which suggests when to use this vs. the quarterly sibling. However, it doesn't provide explicit guidance on when to choose this tool over alternatives like 'consultar_transacoes_cartoes' or 'consultar_taxas_desconto', nor does it mention any prerequisites or exclusions.

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