get_system_timezone
Retrieve the current system timezone to ensure accurate date and time information, addressing timezone confusion in AI responses.
Instructions
Get the system's current timezone
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:151-168 (handler)Executes the 'get_system_timezone' tool by retrieving the system timezone using TimeService and augmenting with current time information in that timezone, returning structured JSON response.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)Registers the 'get_system_timezone' tool in the tools list for ListToolsRequest, including its schema (no input params).{ name: 'get_system_timezone', description: 'Get the system\'s current timezone', inputSchema: { type: 'object', properties: {}, }, },
- src/time-service.ts:25-27 (helper)Helper method that implements the core logic to retrieve the system's current IANA timezone identifier.static getSystemTimezone(): string { return Intl.DateTimeFormat().resolvedOptions().timeZone; }