Skip to main content
Glama
guilhermelirio

Brasil API MCP

cambio-currencies-list

Retrieve available currencies for exchange rate queries from Brazilian public data services.

Instructions

List all available currencies for exchange rates

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Implements the core logic of the 'cambio-currencies-list' tool: fetches currency list from Brasil API endpoint `/cambio/v1/moedas`, handles errors, formats the currencies into a newline-separated list, and returns a structured text response.
      async () => {
        console.error("Listing all available currencies");
        
        const result = await getBrasilApiData(`/cambio/v1/moedas`);
        
        if (!result.success) {
          return formatErrorResponse(`Error listing currencies: ${result.message}`);
        }
        
        // Format the response data
        const currencies = result.data;
        const formattedCurrencies = currencies.map((currency: any) => 
          `${currency.simbolo} - ${currency.nome} (Type: ${currency.tipo_moeda})`
        ).join("\n");
        
        return {
          content: [{ 
            type: "text" as const, 
            text: `Available Currencies:\n${formattedCurrencies}` 
          }]
        };
      }
    );
  • Input schema: empty object `{}`, no parameters required.
    {},
  • Direct registration of the 'cambio-currencies-list' tool using `server.tool()` with name, description, and input schema.
    server.tool(
      "cambio-currencies-list",
      "List all available currencies for exchange rates",
      {},
  • src/index.ts:30-30 (registration)
    Top-level invocation of `registerCambioTools(server)` in the main MCP server setup, which registers the cambio tools including 'cambio-currencies-list'.
    registerCambioTools(server);
  • Shared `getBrasilApiData` helper function called within the handler to perform HTTP GET requests to the Brasil API and handle responses/errors.
    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
        };
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states it's a list operation, implying read-only behavior, but doesn't disclose any behavioral traits like pagination, rate limits, authentication requirements, or what format the list returns. 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 directly states the tool's purpose with zero wasted words. It's appropriately sized for a simple list tool and front-loaded with 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?

Given the tool's simplicity (0 parameters, no output schema, no annotations), the description is minimally complete but lacks important context. It doesn't explain what the list returns (e.g., currency codes, names, symbols) or any behavioral aspects. For a read-only list tool, this is adequate but with clear gaps.

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 0 parameters with 100% schema description coverage (empty schema). The description doesn't need to add parameter semantics since there are none, and the schema fully documents this. Baseline for 0 parameters is 4, as the description appropriately doesn't discuss non-existent parameters.

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 action ('List all available') and resource ('currencies for exchange rates'), providing a specific verb+resource combination. However, it doesn't differentiate from sibling tools like 'bank-list' or 'ibge-states-list' which also list resources, so it doesn't fully distinguish its specific domain.

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?

The description provides no guidance on when to use this tool versus alternatives. There's no mention of prerequisites, when-not-to-use scenarios, or comparison to sibling tools like 'cambio-rate' (which might provide actual exchange rates rather than currency lists).

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