Skip to main content
Glama

get_timezone

Retrieve timezone data and local time for any location using city names, coordinates, or IP addresses. Returns IANA timezone ID, current local time, and Unix timestamp.

Instructions

Get timezone and current local time for any location. Returns IANA timezone ID (e.g. Europe/London), local time string, and unix epoch.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
qYesLocation query — city name, lat/lon, zip, postcode, IATA, or IP.

Implementation Reference

  • The handler implementation for the "get_timezone" tool in the switch statement.
    case "get_timezone": {
      const { q } = args as { q: string };
      result = await weatherRequest("/timezone.json", { q });
      break;
    }
  • The tool definition and schema registration for "get_timezone".
      name: "get_timezone",
      description:
        "Get timezone and current local time for any location. Returns IANA timezone ID (e.g. Europe/London), local time string, and unix epoch.",
      inputSchema: {
        type: "object",
        properties: {
          q: {
            type: "string",
            description: "Location query — city name, lat/lon, zip, postcode, IATA, or IP.",
          },
        },
        required: ["q"],
      },
    },
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses the return format (IANA timezone ID, local time string, unix epoch) and that it queries locations, but lacks details on error handling, rate limits, authentication needs, or data sources. It adds some behavioral context but not comprehensively.

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 front-loaded and concise with a single sentence that efficiently conveys purpose and return values, with no wasted words. Every part earns its place by specifying what is retrieved and the output format.

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 low complexity (1 parameter, no annotations, no output schema), the description is reasonably complete: it states purpose, usage scope, and return format. However, it could improve by adding more behavioral details (e.g., error cases) since there's no output schema to define returns.

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?

Schema description coverage is 100%, so the schema already documents the single parameter 'q' with its description. The description does not add meaning beyond this, as it does not explain parameter usage further. Baseline 3 is appropriate when schema handles parameter documentation.

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?

The description clearly states the tool's purpose with specific verbs ('Get timezone and current local time') and resources ('for any location'), and distinguishes it from siblings like get_current_weather or ip_lookup by focusing on timezone data rather than weather, alerts, or IP information.

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?

The description implies usage by stating it works 'for any location', but does not explicitly guide when to use this tool versus alternatives like ip_lookup (which might provide timezone via IP) or search_locations. No exclusions or specific contexts are provided.

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/weatherapicom/weatherapi-mcp'

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