Skip to main content
Glama

currentDateTime

Retrieve the current date and time for a specified timezone or default to UTC. Input a valid IANA timezone name like 'America/New_York' to get the accurate local time.

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

  • Handler function that takes timezone input (optional, defaults to UTC) and returns the current date and time formatted using Intl.DateTimeFormat.
    (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()),
        }]
      }
    }
  • Zod schema defining the input parameters for the currentDateTime tool: optional nullable timezone string.
    {
        timezone: z.string().optional().nullable().describe(`The timezone should be a valid IANA timezone name like "America/New_York" or "Asia/Kolkata"`),
    },
  • src/server.ts:99-116 (registration)
    Registration of the currentDateTime tool on the MCP server, specifying name, description, input schema, and inline handler function.
    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()),
          }]
        }
      }
    );
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states the tool gets the current date and time, which implies a read-only operation, but doesn't disclose behavioral traits like error handling (e.g., invalid timezone), performance, or output format. The description adds minimal context beyond the basic function, leaving gaps in transparency.

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?

The description is appropriately sized and front-loaded: a single, clear sentence that states the purpose and key parameter detail. There's no wasted language, and every part earns its place by conveying essential information efficiently.

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

Completeness3/5

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

Given the tool's low complexity (one optional parameter, no output schema, no annotations), the description is somewhat complete but has gaps. It covers the basic function and default behavior, but lacks details on output format, error cases, or broader context. It's adequate as a minimum viable description but could be more informative for an agent.

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

Parameters3/5

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

The description adds some meaning beyond the input schema: it clarifies the default behavior ('if timezone is not passed default to UTC'), which isn't in the schema. However, the schema description coverage is 100%, and the schema already documents the timezone parameter well with a description of valid IANA names. The description compensates slightly but doesn't add significant semantic depth, so it meets the baseline.

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

Purpose4/5

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

The description clearly states the tool's purpose: 'Get Current Date and time for timezone.' It specifies the verb ('Get') and resource ('Current Date and time'), and mentions the timezone parameter. However, it doesn't explicitly differentiate from sibling tools, which are unrelated (e.g., contact management, email campaigns), so it's not a 5.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It mentions the default behavior ('if timezone is not passed default to UTC'), but this is parameter-specific and doesn't address broader usage context or comparisons with other tools. No explicit when/when-not or alternative recommendations are given.

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

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

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