Skip to main content
Glama
derikfernandes

BCB Payment Methods MCP Server

consultar_meios_pagamento_trimestral

Retrieve quarterly data on payment card operations and credit transfers from Brazil's Central Bank. Specify quarter in YYYYQ format to access transaction statistics.

Instructions

Consulta dados trimestrais sobre operações com cartões de pagamento e transferências de crédito. Use o formato YYYYQ para o parâmetro trimestre (exemplo: '20234' para o 4º trimestre de 2023).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
trimestreYesAno e trimestre no formato YYYYQ (exemplo: '20234' para 4º trimestre de 2023)
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

Implementation Reference

  • Handler for 'consultar_meios_pagamento_trimestral' tool: extracts parameters from args, fetches data from BCB API endpoint 'MeiosdePagamentosTrimestralDA' using fetchBCBData helper, and returns the JSON response as text content.
    case "consultar_meios_pagamento_trimestral": {
      const { trimestre, top = 100, skip, filtro } = args as {
        trimestre: string;
        top?: number;
        skip?: number;
        filtro?: string;
      };
    
      const data = await fetchBCBData(`MeiosdePagamentosTrimestralDA(trimestre=@trimestre)?@trimestre='${trimestre}'`, {
        formato: "json",
        top,
        skip,
        filter: filtro,
      });
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(data, null, 2),
          },
        ],
      };
    }
  • Tool definition including name, description, and input schema with required 'trimestre' parameter (YYYYQ format) and optional top, skip, filtro for pagination and filtering.
    {
      name: "consultar_meios_pagamento_trimestral",
      description: "Consulta dados trimestrais sobre operações com cartões de pagamento e transferências de crédito. Use o formato YYYYQ para o parâmetro trimestre (exemplo: '20234' para o 4º trimestre de 2023).",
      inputSchema: {
        type: "object",
        properties: {
          trimestre: {
            type: "string",
            description: "Ano e trimestre no formato YYYYQ (exemplo: '20234' para 4º trimestre de 2023)",
          },
          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",
          },
        },
        required: ["trimestre"],
      },
    },
  • Core helper function that makes HTTP requests to the BCB Olinda API, builds the URL with OData parameters, handles errors, and returns the data. Used by all tool handlers including this one.
    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;
      }
    }
  • Helper function to construct the full API URL with OData query parameters like $format, $top, $skip, $filter, $orderby from the input params.
    function buildUrl(endpoint: string, params: QueryParams = {}): string {
      const url = new URL(`${API_BASE_URL}/${endpoint}`);
    
      if (params.formato) url.searchParams.append("$format", params.formato);
      if (params.top) url.searchParams.append("$top", params.top.toString());
      if (params.skip) url.searchParams.append("$skip", params.skip.toString());
      if (params.filter) url.searchParams.append("$filter", params.filter);
      if (params.orderby) url.searchParams.append("$orderby", params.orderby);
    
      return url.toString();
    }
  • src/index.ts:263-267 (registration)
    Registration of tool list handler that returns the array of all tools, including 'consultar_meios_pagamento_trimestral', making it discoverable via ListToolsRequest.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools,
      };
    });
Behavior3/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 reveals this is a query/read operation (implied by 'consulta') and specifies the required parameter format, but doesn't disclose other important behavioral traits like whether this tool requires authentication, has rate limits, returns paginated results, or what the output structure looks like. The description adds some value but leaves significant behavioral aspects undocumented.

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 perfectly concise with just two sentences. The first sentence states the purpose, and the second provides crucial parameter format guidance with a clear example. Every word earns its place, and the information is front-loaded with the most important details first.

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?

For a query tool with 4 parameters, 100% schema coverage, but no annotations and no output schema, the description is moderately complete. It covers the core purpose and critical parameter format, but lacks information about authentication requirements, rate limits, pagination behavior (though 'top' and 'skip' parameters suggest pagination), and output structure. The description should ideally address more of these behavioral aspects given the absence of annotations and output schema.

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 4 parameters thoroughly. The description adds specific format guidance for the 'trimestre' parameter ('Use o formato YYYYQ') and provides an example, which adds value beyond the schema. However, it doesn't provide additional semantic context for the other parameters 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 tool's purpose: 'Consulta dados trimestrais sobre operações com cartões de pagamento e transferências de crédito' (Query quarterly data about payment card operations and credit transfers). This specifies both the verb (query/consulta) and resource (quarterly payment card and credit transfer data). However, it doesn't explicitly differentiate from sibling tools like 'consultar_meios_pagamento_mensal' beyond the quarterly vs monthly distinction.

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 provides some usage context by specifying the required parameter format ('Use o formato YYYYQ para o parâmetro trimestre'), which implies this tool is specifically for quarterly data. However, it doesn't explicitly state when to use this tool versus alternatives like the monthly version or other payment-related tools, nor does it provide exclusion criteria or prerequisites.

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