Skip to main content
Glama
variflight
by variflight

getTodayDate

Retrieve today's date in YYYY-MM-DD format for the local timezone to avoid hardcoding dates in workflows.

Instructions

Get today's date in local timezone (YYYY-MM-DD format). Use this tool whenever you need today's date - NEVER hardcode dates.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
random_stringNoDummy parameter for no-parameter tools

Implementation Reference

  • The async handler function that computes today's date using new Date() in local timezone and formats it as YYYY-MM-DD, returning it as text content.
    }, async () => { const today = new Date(); const year = today.getFullYear(); const month = String(today.getMonth() + 1).padStart(2, '0'); const day = String(today.getDate()).padStart(2, '0'); const todayDate = `${year}-${month}-${day}`; return { content: [ { type: "text", text: todayDate } ] }; });
  • Input schema definition using Zod, with an optional dummy string parameter to support no-parameter tools.
    random_string: z.string() .optional() .describe("Dummy parameter for no-parameter tools")
  • dist/index.js:191-209 (registration)
    Full registration of the getTodayDate tool via server.tool(), including name, description, schema, and inline handler function.
    server.tool("getTodayDate", "Get today's date in local timezone (YYYY-MM-DD format). Use this tool whenever you need today's date - NEVER hardcode dates.", { random_string: z.string() .optional() .describe("Dummy parameter for no-parameter tools") }, async () => { const today = new Date(); const year = today.getFullYear(); const month = String(today.getMonth() + 1).padStart(2, '0'); const day = String(today.getDate()).padStart(2, '0'); const todayDate = `${year}-${month}-${day}`; return { content: [ { type: "text", text: todayDate } ] }; });

Other Tools

Related 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/variflight/variflight-mcp'

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