Skip to main content
Glama
0xKoller

MCP Argentina Datos

by 0xKoller

dolares-por-casa-fecha

Get the exchange rate for a specific currency house in Argentina on a given date. Input the house name and date in YYYY/MM/DD format to retrieve the dollar value.

Instructions

Devuelve la cotización del dólar de la casa de cambio especificada en la fecha indicada (en formato YYYY/MM/DD).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
casaYesEJ: blue, oficial, cripto, etc.
fechaYesEJ: 2025/01/01

Implementation Reference

  • main.ts:316-368 (handler)
    MCP tool handler for 'dolares-por-casa-fecha': validates casa and fecha parameters, calls getDolaresPorCasaFecha helper, handles empty results and errors, returns JSON or text response.
    async ({ casa, fecha }) => {
      if (!casa) {
        return {
          content: [
            {
              type: "text",
              text: "No se ha provisto el parámetro 'casa'",
            },
          ],
        };
      }
      if (!fecha) {
        return {
          content: [
            {
              type: "text",
              text: "No se ha provisto el parámetro 'fecha'",
            },
          ],
        };
      }
      try {
        const data = await getDolaresPorCasaFecha(casa, fecha);
        if (data.length === 0) {
          return {
            content: [
              {
                type: "text",
                text: "No se encontraron cotizaciones de dólares para la casa de cambio especificada en la fecha indicada",
              },
            ],
          };
        }
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(data, null, 2),
              mimeType: "application/json",
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: "Error al obtener la cotización del dólar para la casa de cambio especificada en la fecha indicada",
            },
          ],
        };
      }
    }
  • Core helper function implementing the tool logic: fetches dollar quotation data for specified casa and fecha from the Argentina Datos API.
    export const getDolaresPorCasaFecha = async (casa: string, fecha: string) => {
      const dolares = await fetch(
        `${BASE_URL}/cotizaciones/dolares/${casa}/${fecha}`
      );
      const data = await dolares.json();
      return data;
    };
  • Zod input schema for tool parameters: 'casa' (string, e.g., blue), 'fecha' (string matching YYYY/MM/DD regex).
    {
      casa: z.string().describe("EJ: blue, oficial, cripto, etc."),
      fecha: z
        .string()
        .regex(
          /^\d{4}\/(0[1-9]|1[0-2])\/(0[1-9]|[12][0-9]|3[01])$/,
          "El formato de la fecha debe ser YYYY/MM/DD"
        )
        .describe("EJ: 2025/01/01"),
    },
  • main.ts:303-369 (registration)
    Full registration of the 'dolares-por-casa-fecha' tool with MCP server, specifying name, description, schema, and handler function.
    server.tool(
      "dolares-por-casa-fecha",
      "Devuelve la cotización del dólar de la casa de cambio especificada en la fecha indicada (en formato YYYY/MM/DD).",
      {
        casa: z.string().describe("EJ: blue, oficial, cripto, etc."),
        fecha: z
          .string()
          .regex(
            /^\d{4}\/(0[1-9]|1[0-2])\/(0[1-9]|[12][0-9]|3[01])$/,
            "El formato de la fecha debe ser YYYY/MM/DD"
          )
          .describe("EJ: 2025/01/01"),
      },
      async ({ casa, fecha }) => {
        if (!casa) {
          return {
            content: [
              {
                type: "text",
                text: "No se ha provisto el parámetro 'casa'",
              },
            ],
          };
        }
        if (!fecha) {
          return {
            content: [
              {
                type: "text",
                text: "No se ha provisto el parámetro 'fecha'",
              },
            ],
          };
        }
        try {
          const data = await getDolaresPorCasaFecha(casa, fecha);
          if (data.length === 0) {
            return {
              content: [
                {
                  type: "text",
                  text: "No se encontraron cotizaciones de dólares para la casa de cambio especificada en la fecha indicada",
                },
              ],
            };
          }
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(data, null, 2),
                mimeType: "application/json",
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: "Error al obtener la cotización del dólar para la casa de cambio especificada en la fecha indicada",
              },
            ],
          };
        }
      }
    );

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/0xKoller/mcp-argentina-datos'

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