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
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_system_timezone"
}
}Input 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; }