dolares-historico
Access historical dollar exchange rates from all currency exchange houses in Argentina using this tool. Retrieve accurate data for analysis or decision-making.
Instructions
Devuelve las cotizaciones de todas las casas de cambio.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- main.ts:218-247 (handler)MCP server tool handler for 'dolares-historico': calls getDolaresHistorico, handles response formatting, empty data, and errors.async ({}) => { try { const data = await getDolaresHistorico(); if (data.length === 0) { return { content: [ { type: "text", text: "No se encontraron cotizaciones de dólares" }, ], }; } return { content: [ { type: "text", text: JSON.stringify(data, null, 2), mimeType: "application/json", }, ], }; } catch (error) { return { content: [ { type: "text", text: "Error al obtener las cotizaciones de dólares", }, ], }; } }
- utils/functions.ts:14-18 (helper)Core implementation: fetches historical dollar quotes from https://api.argentinadatos.com/v1/cotizaciones/dolares/ API endpoint.export const getDolaresHistorico = async () => { const dolares = await fetch(`${BASE_URL}/cotizaciones/dolares/`); const data = await dolares.json(); return data; };
- main.ts:214-248 (registration)Registration of the 'dolares-historico' tool using server.tool, including name, description, parameters schema, and handler.server.tool( "dolares-historico", "Devuelve las cotizaciones de todas las casas de cambio.", {}, async ({}) => { try { const data = await getDolaresHistorico(); if (data.length === 0) { return { content: [ { type: "text", text: "No se encontraron cotizaciones de dólares" }, ], }; } return { content: [ { type: "text", text: JSON.stringify(data, null, 2), mimeType: "application/json", }, ], }; } catch (error) { return { content: [ { type: "text", text: "Error al obtener las cotizaciones de dólares", }, ], }; } } );
- main.ts:42-46 (schema)Tool schema for discovery in server constructor: name, description, and parameters.{ name: "dolares-historico", description: "Devuelve las cotizaciones de todas las casas de cambio.", parameters: {}, },