Skip to main content
Glama
derikfernandes

BCB Payment Methods MCP Server

consultar_taxas_desconto

Query discount rates charged to commercial establishments for payment method operations. Retrieve data by quarter with optional filters to analyze transaction costs.

Instructions

Consulta taxas de desconto cobradas de estabelecimentos comerciais por operações com meios de pagamento.

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

  • Tool schema definition for 'consultar_taxas_desconto', including name, description, and input schema requiring 'trimestre' parameter.
    {
      name: "consultar_taxas_desconto",
      description: "Consulta taxas de desconto cobradas de estabelecimentos comerciais por operações com meios de pagamento.",
      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"],
      },
    },
  • MCP handler for 'consultar_taxas_desconto' tool in CallToolRequestSchema. Extracts parameters, calls fetchBCBData on 'TaxasDescontoDA' endpoint, and returns JSON data.
    case "consultar_taxas_desconto": {
      const { trimestre, top = 100, filtro } = args as {
        trimestre: string;
        top?: number;
        filtro?: string;
      };
    
      const data = await fetchBCBData(`TaxasDescontoDA(trimestre=@trimestre)?@trimestre='${trimestre}'`, {
        formato: "json",
        top,
        filter: filtro,
      });
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(data, null, 2),
          },
        ],
      };
    }
  • Tool schema definition for 'consultar_taxas_desconto', including name, description, and input schema requiring 'trimestre' parameter.
    {
      name: "consultar_taxas_desconto",
      description: "Consulta taxas de desconto cobradas de estabelecimentos comerciais por operações com meios de pagamento.",
      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"],
      },
    },
  • MCP handler for 'consultar_taxas_desconto' tool in CallToolRequestSchema within createMCPServer function. Fetches data from BCB API.
    case "consultar_taxas_desconto": {
      const { trimestre, top = 100, filtro } = args as {
        trimestre: string;
        top?: number;
        filtro?: string;
      };
    
      const data = await fetchBCBData(`TaxasDescontoDA(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 the BCB Olinda API, used by all tool handlers including 'consultar_taxas_desconto'.
    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 but provides minimal behavioral information. It states this is a query operation but doesn't disclose important details like whether it's read-only, what permissions might be needed, rate limits, pagination behavior (beyond the 'top' parameter), or what format the results will be in. For a tool with 3 parameters and no output schema, 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 a single, efficient sentence that gets straight to the point. Every word contributes to understanding the tool's purpose without any fluff or redundancy. It's appropriately sized for what it communicates.

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?

For a query tool with 3 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what the tool returns, how results are structured, or provide context about the data source. While the schema covers parameters well, the overall tool behavior remains opaque to an AI agent trying to understand what to expect from using this tool.

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 doesn't add any parameter-specific information beyond what's in the schema. It doesn't explain how parameters interact or provide examples of typical parameter combinations. Baseline 3 is appropriate when the schema does the documentation work.

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 ('taxas de desconto cobradas de estabelecimentos comerciais por operações com meios de pagamento' - discount rates charged to commercial establishments for payment operations). It distinguishes from most siblings which query different resources, though it doesn't explicitly differentiate from 'consultar_taxas_intercambio' which also deals with rates.

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 doesn't mention the sibling tools, explain what makes this tool unique, or specify use cases where this tool is preferred over others like 'consultar_taxas_intercambio' or the various payment method queries.

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