get_timezone
Retrieve the timezone identifier (e.g., Asia/Tokyo) for accurate time-based operations using the Time Tools MCP Server.
Instructions
Get timezone (e.g. Asia/Tokyo)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:24-33 (handler)The handler for the 'get_timezone' tool. It calls the getTZ() helper to retrieve the current timezone (guessed by dayjs.tz.guess() if not provided) and returns it as text content.server.tool("get_timezone", "Get timezone (e.g. Asia/Tokyo)", async () => { return { content: [ { type: "text", text: getTZ(), }, ], }; });
- src/index.ts:24-33 (registration)Registration of the 'get_timezone' tool on the McpServer instance using server.tool().server.tool("get_timezone", "Get timezone (e.g. Asia/Tokyo)", async () => { return { content: [ { type: "text", text: getTZ(), }, ], }; });
- src/index.ts:13-15 (helper)Helper function getTZ used by get_timezone tool to determine the timezone, defaulting to dayjs.tz.guess().const getTZ = (timezon?: string) => { return timezon || dayjs.tz.guess(); };