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;
      }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

C2.9/5.0
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 indicates a query-like read operation, but does not disclose whether it is read-only, whether authentication or permissions are needed, how results are returned, or any side effects. This is minimal for a tool with no annotation support.

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 a single, focused sentence with no redundant or filler content. It is efficiently front-loaded with the core action and resource, though it is arguably too brief given the lack of annotations and sibling differentiation.

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?

The tool has no annotations, no output schema, and several closely related sibling tools. The description does not explain the return value, required quarter format behavior, pagination implications, or how this tool differs from alternatives. This is not enough context for an agent to select and invoke it correctly in all situations.

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 input schema already documents all three parameters including the required 'trimestre' format and the 'top' and 'filtro' purpose. The description adds no parameter-level meaning beyond the schema, which lands at the baseline of 3.

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 a specific action ('Consulta') and a specific resource ('taxas de desconto cobradas de estabelecimentos comerciais por operações com meios de pagamento'). The subject matter is distinct enough from sibling tools like consultar_taxas_intercambio or consultar_transacoes_cartoes, though it does not explicitly name or contrast itself with any sibling.

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 guidance is given on when to use this tool versus sibling alternatives. The description only states what the tool does, leaving the agent to infer usage context; it does not mention exclusions, prerequisites, or preferred scenarios.

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