Skip to main content
Glama

get_system_timezone

Retrieve the current system timezone for accurate, timezone-aware date and time operations, resolving inconsistencies caused by timezone mismatches.

Instructions

Get the system's current timezone

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP server request handler for the 'get_system_timezone' tool. Retrieves the system timezone using TimeService and enriches with current time info in the system timezone.
    case 'get_system_timezone': { const systemTimezone = TimeService.getSystemTimezone(); const currentTime = TimeService.getCurrentTime(systemTimezone, 'full'); return { content: [ { type: 'text', text: JSON.stringify({ systemTimezone, currentTime: currentTime.localizedFormat, utcOffset: currentTime.utcOffset, isDST: currentTime.isDST, }, null, 2), }, ], }; }
  • src/index.ts:72-79 (registration)
    Tool registration in the list of available tools for the MCP server, including name, description, and empty input schema.
    { name: 'get_system_timezone', description: 'Get the system\'s current timezone', inputSchema: { type: 'object', properties: {}, }, },
  • Core helper function in TimeService that implements the logic to get the system's current timezone using JavaScript's Intl API.
    static getSystemTimezone(): string { return Intl.DateTimeFormat().resolvedOptions().timeZone; }

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/davidan90/time-node-mcp'

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