Skip to main content
Glama
odgrim

MCP DateTime

by odgrim

list-timezones

Retrieve a comprehensive list of all available timezones for accurate datetime handling and scheduling across global regions.

Instructions

List all available timezones

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'list-timezones' tool, registered inline with server.tool(). It returns a text content with the formatted list of available timezones obtained from getFormattedTimezoneList().
    server.tool(
      "list-timezones",
      "List all available timezones",
      async () => {
        return {
          content: [{ 
            type: "text", 
            text: getFormattedTimezoneList()
          }]
        };
      }
    );
  • src/server.ts:73-84 (registration)
    Registration of the 'list-timezones' tool using server.tool(), including its description and handler.
    server.tool(
      "list-timezones",
      "List all available timezones",
      async () => {
        return {
          content: [{ 
            type: "text", 
            text: getFormattedTimezoneList()
          }]
        };
      }
    );
  • Helper function that formats the list of available timezones into a readable string, used by the list-timezones tool handler.
    export function getFormattedTimezoneList(prefix: string = "Available timezones"): string {
      const timezones = getAvailableTimezones();
      return `${prefix} (${timezones.length}): ${timezones.join(', ')}`;
    }
  • Core helper that retrieves all available timezones using Intl.supportedValuesOf('timeZone'), adds common ones, sorts them, with fallback to COMMON_TIMEZONES.
    export function getAvailableTimezones(): string[] {
      try {
        const timezones = new Set<string>(Intl.supportedValuesOf('timeZone'));
        
        // Ensure common timezones are always included
        COMMON_TIMEZONES.forEach(tz => timezones.add(tz));
        
        return Array.from(timezones).sort();
      } catch (error) {
        console.error("Error getting timezones from Intl API:", error);
        // Fallback to common timezones if the Intl API fails
        return COMMON_TIMEZONES;
      }
    }
  • Array of common timezones ensured to be available as fallback and for resource listing.
    export const COMMON_TIMEZONES = [
      "UTC",
      "Europe/London",
      "Europe/Paris",
      "Europe/Berlin",
      "America/New_York",
      "America/Chicago",
      "America/Denver",
      "America/Los_Angeles",
      "Asia/Tokyo",
      "Asia/Shanghai",
      "Asia/Kolkata",
      "Australia/Sydney",
      "Pacific/Auckland"
    ];
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('List') but doesn't describe return format, pagination, rate limits, or error handling. This is a significant gap for a tool with zero annotation coverage.

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 a single, efficient sentence with zero waste. It's front-loaded and appropriately sized for a simple tool, making it easy for an agent to parse quickly.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what the return value looks like (e.g., list format, timezone identifiers), which is critical for a tool that lists data. This gap reduces usability for an AI agent.

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?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately doesn't mention parameters, earning a high baseline score for not adding unnecessary information.

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 verb ('List') and resource ('all available timezones'), making the purpose unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'get-current-timezone' or 'get-time-in-timezone', which prevents a perfect score.

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 like 'get-current-timezone' or 'get-time-in-timezone'. It lacks context about use cases, prerequisites, or exclusions, leaving the agent to infer usage from tool names alone.

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/odgrim/mcp-datetime'

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