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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/banks.ts:10-24 (handler)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`); } },
- src/tools/banks.ts:6-9 (schema)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); });
- src/utils/index.ts:4-6 (helper)Helper function used in the handler to format the JSON response with indentation.export const prettifyJson = (data: any) => { return JSON.stringify(data, null, 2); };
- src/utils/index.ts:8-10 (helper)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); };