Skip to main content
Glama
gtorreal
by gtorreal

get_available_banks

Lists banks accepted for deposits and withdrawals of a specified fiat currency on Buda.com, returning empty for unsupported currencies.

Instructions

Returns banks available for deposits and withdrawals of a fiat currency on Buda.com. Returns an empty banks array (not an error) if the currency has no associated banks (e.g. crypto currencies or unsupported fiat currencies). Results are cached for 60 seconds. Example: 'Which banks can I use for CLP deposits?'

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
currencyYesCurrency code (e.g. 'CLP', 'COP', 'PEN').

Implementation Reference

  • The main handler function that validates currency, fetches banks from the Buda API (with caching), and returns the list of banks or an empty array on 404.
    export async function handleGetAvailableBanks(
      args: { currency: string },
      client: BudaClient,
      cache: MemoryCache,
    ): Promise<{ content: Array<{ type: "text"; text: string }>; isError?: boolean }> {
      const { currency } = args;
    
      const validationError = validateCurrency(currency);
      if (validationError) {
        return {
          content: [{ type: "text", text: JSON.stringify({ error: validationError, code: "INVALID_CURRENCY" }) }],
          isError: true,
        };
      }
    
      const currencyUpper = currency.toUpperCase();
    
      try {
        const data = await cache.getOrFetch<BanksResponse>(
          `banks:${currencyUpper}`,
          CACHE_TTL.BANKS,
          () => client.get<BanksResponse>(`/currencies/${currencyUpper}/banks`),
        );
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(
                {
                  currency: currencyUpper,
                  banks: data.banks.map((b) => ({ id: b.id, name: b.name, country: b.country ?? null })),
                },
                null,
                2,
              ),
            },
          ],
        };
      } catch (err) {
        // 404 means no banks exist for this currency — return empty list (not an error)
        if (err instanceof BudaApiError && err.status === 404) {
          return {
            content: [{ type: "text", text: JSON.stringify({ currency: currencyUpper, banks: [] }, null, 2) }],
          };
        }
        const msg = formatApiError(err);
        return {
          content: [{ type: "text", text: JSON.stringify(msg) }],
          isError: true,
        };
      }
    }
  • The tool schema defining name 'get_available_banks', description, and input schema requiring a 'currency' string.
    export const toolSchema = {
      name: "get_available_banks",
      description:
        "Returns banks available for deposits and withdrawals of a fiat currency on Buda.com. " +
        "Returns an empty banks array (not an error) if the currency has no associated banks " +
        "(e.g. crypto currencies or unsupported fiat currencies). " +
        "Results are cached for 60 seconds. " +
        "Example: 'Which banks can I use for CLP deposits?'",
      inputSchema: {
        type: "object" as const,
        properties: {
          currency: {
            type: "string",
            description: "Currency code (e.g. 'CLP', 'COP', 'PEN').",
          },
        },
        required: ["currency"],
      },
    };
  • Registers the tool with the McpServer using the schema name, description, a Zod-validated currency parameter, and a callback to the handler.
    export function register(server: McpServer, client: BudaClient, cache: MemoryCache): void {
      server.tool(
        toolSchema.name,
        toolSchema.description,
        {
          currency: z.string().min(2).max(10).describe("Currency code (e.g. 'CLP', 'COP', 'PEN')."),
        },
        (args) => handleGetAvailableBanks(args, client, cache),
      );
    }
  • Type definitions for Bank (id, name, country) and BanksResponse used by the handler.
    export interface Bank {
      id: string;
      name: string;
      country: string | null;
    }
    
    export interface BanksResponse {
      banks: Bank[];
    }
  • The validateCurrency helper used by the handler to validate the currency input.
    export function validateCurrency(id: string): string | null {
      if (!CURRENCY_RE.test(id)) {
        return (
          `Invalid currency. ` +
          `Expected 2–10 alphanumeric characters (e.g. "BTC", "CLP", "USDC").`
        );
      }
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Discloses non-error empty array for unsupported currencies and 60-second caching, providing useful behavioral context beyond the schema.

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?

Three sentences efficiently cover purpose, edge case, caching, and an example without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Completeness is high: explains return type (array, potentially empty) and caching, sufficient for a simple read tool with no output schema.

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?

Adds context that currency parameter refers to fiat currency for deposit/withdrawal purposes, enriching the schema's code-only description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states the tool returns banks for deposits/withdrawals of a fiat currency on Buda.com, differentiating it from sibling tools focused on markets and orders.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Implicitly guides usage by specifying fiat currencies and noting crypto gives empty array, but does not explicitly contrast with other tools.

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/gtorreal/buda-mcp'

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