Skip to main content
Glama

get_current_date_time_iso

Retrieve the current date and time in ISO 8601 format, with an optional timezone parameter, using the 'Time Tools MCP Server' for accurate time manipulation tasks.

Instructions

Get ISO 8601 time. (e.g. 2025-05-07T23:03:27+09:00)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
timezoneNo

Implementation Reference

  • The handler function for the 'get_current_date_time_iso' tool. It computes the current date and time in ISO 8601 format using dayjs in the specified (or default) timezone.
    async ({ timezone }) => { const currentDateTime = dayjs().tz(getTZ(timezone)).format(); return { content: [ { type: "text", text: currentDateTime, }, ], }; },
  • Input schema for the tool, defining an optional 'timezone' string parameter.
    { timezone: z.string().optional(), },
  • src/index.ts:112-129 (registration)
    Registration of the 'get_current_date_time_iso' tool on the MCP server using server.tool().
    server.tool( "get_current_date_time_iso", "Get ISO 8601 time. (e.g. 2025-05-07T23:03:27+09:00)", { timezone: z.string().optional(), }, async ({ timezone }) => { const currentDateTime = dayjs().tz(getTZ(timezone)).format(); return { content: [ { type: "text", text: currentDateTime, }, ], }; }, );
  • Helper function 'getTZ' used by the tool handler to determine the timezone, defaulting to the guessed timezone if not provided.
    const getTZ = (timezon?: string) => { return timezon || dayjs.tz.guess(); };

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/t-shiratori/time-tools-mcp-server'

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