Skip to main content
Glama

listTimezones

Retrieve all IANA timezones with optional region filtering to support global time management and scheduling applications.

Instructions

List all available IANA timezones

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
regionNoFilter timezones by region (e.g., America, Europe)

Implementation Reference

  • The handler function for the 'listTimezones' tool. Retrieves all IANA timezones using Intl.supportedValuesOf('timeZone'), optionally filters by region prefix, and returns them as JSON (note: currently serializes unfiltered zones).
    handler: async ({ region }: { region?: string }) => {
      try {
        // Get list of unique timezone names from Luxon
        const zones = Array.from(new Set(
          Intl.supportedValuesOf('timeZone')
        ));
        
        const filteredZones = region
          ? zones.filter((zone: string) => zone.startsWith(region))
          : zones;
    
        return {
          content: [{
            type: 'text',
            text: JSON.stringify(zones, null, 2)
          }]
        };
      } catch (error) {
        throw new Error(`Failed to list timezones: ${error instanceof Error ? error.message : 'Unknown error'}`);
      }
    }
  • Input schema definition for the 'listTimezones' tool, specifying an optional 'region' string parameter for filtering.
    inputSchema: {
      type: 'object',
      properties: {
        region: {
          type: 'string',
          description: 'Filter timezones by region (e.g., America, Europe)',
          optional: true
        }
      }
    },
  • The complete tool definition object for 'listTimezones' within the dateTimeTools export, including name, description, inputSchema, and handler. This object is imported and spread into the main allTools registry in src/index.ts.
    listTimezones: {
      name: 'listTimezones',
      description: 'List all available IANA timezones',
      inputSchema: {
        type: 'object',
        properties: {
          region: {
            type: 'string',
            description: 'Filter timezones by region (e.g., America, Europe)',
            optional: true
          }
        }
      },
      handler: async ({ region }: { region?: string }) => {
        try {
          // Get list of unique timezone names from Luxon
          const zones = Array.from(new Set(
            Intl.supportedValuesOf('timeZone')
          ));
          
          const filteredZones = region
            ? zones.filter((zone: string) => zone.startsWith(region))
            : zones;
    
          return {
            content: [{
              type: 'text',
              text: JSON.stringify(zones, null, 2)
            }]
          };
        } catch (error) {
          throw new Error(`Failed to list timezones: ${error instanceof Error ? error.message : 'Unknown error'}`);
        }
      }
    }
  • src/index.ts:28-35 (registration)
    Registration of all tools by spreading individual toolkits (including dateTimeTools containing listTimezones) into the central allTools object used by MCP request handlers for tool listing and execution.
    const allTools: ToolKit = {
      ...systemTools,
      ...networkTools,
      ...geoTools,
      ...generatorTools,
      ...dateTimeTools,
      ...securityTools
    };
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. For a tool with zero annotation coverage, this is a significant gap 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 a single, efficient sentence with zero wasted words. It's front-loaded with the core purpose and appropriately sized for a simple list operation.

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?

For a simple list tool with one optional parameter and no output schema, the description is minimally adequate. However, it lacks details on return format or behavioral traits, which would be helpful given the absence of annotations and output schema.

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 input schema has 100% description coverage, so the schema fully documents the optional 'region' parameter. The description doesn't add any parameter details beyond what the schema provides, but the high coverage justifies the baseline score of 3.

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 IANA timezones'), making the purpose unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'convertTimezone' or 'getCurrentTime', 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 'convertTimezone' or 'getCurrentTime'. It lacks any context about prerequisites, exclusions, or typical use cases, leaving the agent with minimal direction.

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/cyanheads/toolkit-mcp-server'

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