Skip to main content
Glama

currentDateTime

Obtain the current date and time for any valid IANA timezone. Defaults to UTC if no timezone is provided. Useful for scheduling and timestamp generation.

Instructions

Get Current Date and time for timezone. if timezone is not passed default to UTC

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
timezoneNoThe timezone should be a valid IANA timezone name like "America/New_York" or "Asia/Kolkata"

Implementation Reference

  • src/server.ts:99-116 (registration)
    Registration of the 'currentDateTime' tool via server.tool(), including schema (timezone as optional string) and inline handler using Intl.DateTimeFormat to format the current date/time.
    server.tool("currentDateTime", "Get Current Date and time for timezone. if timezone is not passed default to UTC",
      {
          timezone: z.string().optional().nullable().describe(`The timezone should be a valid IANA timezone name like "America/New_York" or "Asia/Kolkata"`),
      },
      (data) => {
        const formatter = new Intl.DateTimeFormat("en-US", {
        timeZone: data.timezone || "UTC",
        dateStyle: "full",
        timeStyle: "long",
      });
          return {
            content: [{
              type: "text",
              text: formatter.format(new Date()),
          }]
        }
      }
    );
  • The inline handler for currentDateTime. It creates an Intl.DateTimeFormat formatter with the given timezone (or UTC), formats the current date, and returns it as text content.
    (data) => {
      const formatter = new Intl.DateTimeFormat("en-US", {
      timeZone: data.timezone || "UTC",
      dateStyle: "full",
      timeStyle: "long",
    });
        return {
          content: [{
            type: "text",
            text: formatter.format(new Date()),
        }]
      }
    }
  • Schema definition for currentDateTime: 'timezone' is an optional nullable string described as a valid IANA timezone name.
    server.tool("currentDateTime", "Get Current Date and time for timezone. if timezone is not passed default to UTC",
      {
          timezone: z.string().optional().nullable().describe(`The timezone should be a valid IANA timezone name like "America/New_York" or "Asia/Kolkata"`),
      },
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description fully carries burden. It clearly indicates a read operation returning date/time for a given timezone, with default behavior. However, it omits response format details.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two concise sentences, front-loaded with purpose, no extraneous words. Every sentence adds value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (one optional param, no output schema), description covers core usage. Minor gap: no indication of response format, but agent can infer a datetime string.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Input schema has 100% coverage with description for 'timezone'. Description adds value by stating default behavior not found in schema, providing meaningful context beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states the verb 'Get', the resource 'Current Date and time', and the scope 'for timezone'. No sibling tools perform similar function, making it easily distinguishable.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Description explains default behavior when timezone is omitted ('default to UTC'), but does not provide explicit when-to-use or when-not-to-use guidance compared to sibling tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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/mailmodo/mailmodo-mcp'

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