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
| Name | Required | Description | Default |
|---|---|---|---|
| type | Yes | Dollar type: blue, oficial, bolsa, contadoconliqui, cripto, mayorista, tarjeta |
Implementation Reference
- src/actions.ts:26-31 (handler)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)}`); } - src/mcp-server.ts:28-43 (registration)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 }; } }, ); - src/schemas.ts:1-3 (schema)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), }, }; }