Skip to main content
Glama
guilhermelirio

Brasil API MCP

bank-list

Retrieve a comprehensive list of Brazilian banks through the Brasil API MCP server, enabling access to banking institution data for integration and reference purposes.

Instructions

List all Brazilian banks

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the bank-list tool. Fetches the list of Brazilian banks from BrasilAPI, formats as a list, handles errors, and returns text content.
    async () => {
      console.error("Listing all banks");
      
      const result = await getBrasilApiData(`/banks/v1`);
      
      if (!result.success) {
        return formatErrorResponse(`Error listing banks: ${result.message}`);
      }
      
      // Format the response data
      const banks = result.data;
      const formattedBanks = banks.map((bank: any) => 
        `${bank.code} - ${bank.name} (${bank.ispb})`
      ).join("\n");
      
      return {
        content: [{ 
          type: "text" as const, 
          text: `Banks in Brazil:\n${formattedBanks}` 
        }]
      };
    }
  • Registers the 'bank-list' tool to the MCP server with description, empty input schema {}, and handler function.
    server.tool(
      "bank-list",
      "List all Brazilian banks",
      {},
      async () => {
        console.error("Listing all banks");
        
        const result = await getBrasilApiData(`/banks/v1`);
        
        if (!result.success) {
          return formatErrorResponse(`Error listing banks: ${result.message}`);
        }
        
        // Format the response data
        const banks = result.data;
        const formattedBanks = banks.map((bank: any) => 
          `${bank.code} - ${bank.name} (${bank.ispb})`
        ).join("\n");
        
        return {
          content: [{ 
            type: "text" as const, 
            text: `Banks in Brazil:\n${formattedBanks}` 
          }]
        };
      }
    );
  • src/index.ts:27-27 (registration)
    Invokes registerBankTools to add bank tools (incl. bank-list) to the main MCP server instance.
    registerBankTools(server);
  • API client helper function used to fetch bank list data from BrasilAPI.
    export async function getBrasilApiData(endpoint: string, params: Record<string, any> = {}) {
      try {
        const url = `${BASE_URL}${endpoint}`;
        console.error(`Making request to: ${url}`);
        
        const response = await axios.get(url, { params });
        return { 
          data: response.data,
          success: true
        };
      } catch (error: any) {
        console.error(`Error in API request: ${error.message}`);
        
        // Handle API errors in a structured format
        if (error.response) {
          return {
            success: false,
            statusCode: error.response.status,
            message: error.response.data?.message || error.message,
            error: error.response.data
          };
        }
        
        return {
          success: false,
          message: error.message,
          error
        };
      }
    }
  • Utility to format error responses consistently in MCP format.
    export function formatErrorResponse(message: string) {
      return {
        content: [{ 
          type: "text" as const, 
          text: message 
        }],
        isError: true
      };
    }
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 states it's a list operation but doesn't describe return format, pagination, rate limits, or error conditions. For a tool with zero annotation coverage, this is insufficient.

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 communicates the core purpose without any wasted words. It's appropriately sized for a simple list tool and front-loads the essential information.

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 simple list tool with no parameters and no output schema, the description adequately states what it does. However, without annotations or output schema, it should ideally provide more behavioral context about what the list contains and how it's structured.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters with 100% schema description coverage, so the schema already documents this completely. The description appropriately doesn't add parameter information, maintaining focus on the tool's purpose. Baseline 4 for zero parameters is appropriate.

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 ('List') and resource ('all Brazilian banks'), making the purpose immediately understandable. However, it doesn't differentiate from its sibling 'bank-search', which might serve a similar purpose with filtering capabilities.

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 provided about when to use this tool versus alternatives like 'bank-search'. The description lacks context about use cases, prerequisites, or exclusions, leaving the agent to infer usage patterns.

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/guilhermelirio/brasil-api-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server