Skip to main content
Glama

get_all_banks

Retrieve comprehensive data on all Brazilian banks through the Brasil API MCP server. This tool provides bank information for applications requiring financial institution details in Brazil.

Instructions

Get information of all banks from Brazil.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the get_all_banks tool. It fetches all banks using the brasilApiClient, formats the response as pretty JSON, and returns it as text content. Handles errors by throwing a descriptive message.
    handler: async () => { try { const result = await brasilApiClient.bank.getAll(); const content: McpTextContent = { type: "text", text: prettifyJson(result.data), }; return { content: [content], }; } catch (error: any) { console.error(error); throw new Error(`Failed to fetch banks`); } },
  • Tool definition including name, description, and empty params schema indicating no input parameters required.
    export const getAllBanksTool: McpToolDefinition = { name: "get_all_banks", description: "Get information of all banks from Brazil.", params: {},
  • src/index.ts:30-41 (registration)
    The getAllBanksTool is included in the tools array and registered on the MCP server using registerTool in a loop over all tools.
    const tools = [ getCepTool, getCepV2Tool, getBookByISBNTool, getCNPJTool, getAllBanksTool, getBankByCodeTool, ]; tools.forEach((tool) => { registerTool(server, tool); });
  • Helper function used in the handler to format the JSON response with indentation.
    export const prettifyJson = (data: any) => { return JSON.stringify(data, null, 2); };
  • Helper function used to register each tool on the MCP server.
    export const registerTool = (server: McpServer, tool: McpToolDefinition) => { server.tool(tool.name, tool.description, tool.params, tool.handler); };

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/mauricio-cantu/brasil-api-mcp-server'

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