getTodayDate
Retrieve today's date in YYYY-MM-DD format from the Variflight Tripmatch MCP Server for accurate travel planning and booking operations.
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
| Name | Required | Description | Default |
|---|---|---|---|
| random_string | No | Dummy parameter for no-parameter tools |
Implementation Reference
- dist/index.js:170-184 (handler)The handler function that computes today's date in the local timezone and formats it as YYYY-MM-DD, returning it in the MCP content format.}, 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 } ] }; });
- dist/index.js:167-169 (schema)Zod input schema for the tool, featuring a dummy optional string parameter to satisfy MCP requirements for tools to have at least one parameter.random_string: z.string() .optional() .describe("Dummy parameter for no-parameter tools")
- dist/index.js:166-184 (registration)The server.tool call that registers the 'getTodayDate' tool with the MCP server, including its description, input 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 } ] }; });