Skip to main content
Glama
stadiamaps

Stadia Maps Location API MCP Server

time-and-zone-info

Retrieve current time, time zone details, and UTC offset for any geographic coordinates, including IANA TZID and RFC 2822 timestamp, with precise location-based results.

Instructions

Get the current time and zone info at any point (geographic coordinates). Output includes includes the standard UTC offset, special offset currently in effect (typically but not always Daylight Saving Time), IANA TZID, and the current timestamp in RFC 28222 format.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
latYesThe latitude of the point.
lonYesThe longitude of the point.

Implementation Reference

  • The handler function that performs timezone lookup using Stadia Maps Geospatial API and returns formatted time and zone information.
    export async function timeAndZoneInfo({ lat, lon, }: Coordinates): Promise<CallToolResult> { return handleToolError( async () => { const res = await miscApi.tzLookup({ lat, lng: lon, }); return { content: [ { type: "text", text: [ `TZID: ${res.tzId}`, `Standard UTC offset: ${res.baseUtcOffset}`, `Special offset (e.g. DST): ${res.dstOffset}`, `Current time (RFC 2822): ${res.localRfc2822Timestamp}`, ].join("\n"), }, ], }; }, { contextMessage: "Timezone lookup failed", enableLogging: true, }, ); }
  • src/index.ts:37-45 (registration)
    Registers the 'time-and-zone-info' tool with the MCP server, including name, description, input schema, and the handler function.
    server.tool( "time-and-zone-info", "Get the current time and zone info at any point (geographic coordinates). Output includes includes the standard UTC offset, special offset currently in effect (typically but not always Daylight Saving Time), IANA TZID, and the current timestamp in RFC 28222 format.", { lat: latitudeSchema, lon: longitudeSchema, }, timeAndZoneInfo, );
  • Zod schemas defining the input parameters 'lat' and 'lon' for the tool.
    export const latitudeSchema = z .number() .min(-90) .max(90) .describe("The latitude of the point."); export const longitudeSchema = z .number() .min(-180) .max(180) .describe("The longitude of the point.");
  • TypeScript type for coordinates used in the handler function signature.
    export type Coordinates = { lat: number; lon: number;

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/stadiamaps/stadiamaps-mcp-server-ts'

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