Skip to main content
Glama
dan1d

dolar-mcp

get_dollar

Retrieve real-time Argentine dollar exchange rates including blue, official, MEP, CCL, and crypto types for financial analysis and conversion.

Instructions

Get a specific dollar exchange rate. Types: blue, oficial, bolsa, contadoconliqui, cripto, mayorista, tarjeta.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeYesDollar type: blue, oficial, bolsa, contadoconliqui, cripto, mayorista, tarjeta

Implementation Reference

  • The main handler function getDollar that executes the get_dollar tool logic. It takes a DolarApiClient and GetDollarParams, then makes an API call to fetch the specific dollar exchange rate type.
    export async function getDollar(
      client: DolarApiClient,
      params: GetDollarParams
    ): Promise<unknown> {
      return client.get<DollarRate>(`/v1/dolares/${encodeURIComponent(params.type)}`);
    }
  • MCP server tool registration for 'get_dollar'. Defines the tool name, description, input schema using Zod validation, and the handler that calls tools.get_dollar(params).
    server.tool(
      "get_dollar",
      "Get a specific dollar exchange rate. Types: blue, oficial, bolsa, contadoconliqui, cripto, mayorista, tarjeta.",
      {
        type: z.string().describe("Dollar type: blue, oficial, bolsa, contadoconliqui, cripto, mayorista, tarjeta"),
      },
      async (params) => {
        try {
          const result = await tools.get_dollar(params);
          return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
        } catch (error) {
          const message = error instanceof Error ? error.message : String(error);
          return { content: [{ type: "text", text: message }], isError: true };
        }
      },
    );
  • TypeScript interface defining the input parameters for get_dollar tool. Expects a 'type' string specifying the dollar exchange rate type.
    export interface GetDollarParams {
      type: string;
    }
  • src/index.ts:17-30 (registration)
    The createDolarTools function that creates and exports the tools object, mapping get_dollar to the getDollar handler with client and params.
    export function createDolarTools() {
      const client = new DolarApiClient();
    
      return {
        tools: {
          get_all_dollars: () => getAllDollars(client),
          get_dollar: (params: GetDollarParams) => getDollar(client, params),
          get_all_currencies: () => getAllCurrencies(client),
          get_currency: (params: GetCurrencyParams) => getCurrency(client, params),
          convert: (params: ConvertParams) => convert(client, params),
          get_spread: (params: GetSpreadParams) => getSpread(client, params),
        },
      };
    }

Tool Definition Quality

Score is being calculated. Check back soon.

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/dan1d/dolar-mcp'

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