getTimezone
Retrieve the current device's timezone information to handle time-sensitive operations and ensure accurate scheduling across different regions.
Instructions
获取当前设备的时区信息
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:600-608 (handler)Handler implementation for the 'getTimezone' tool. Retrieves the current timezone using JavaScript's Intl.DateTimeFormat API and returns it as a JSON-formatted text response.case "getTimezone": { const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone; return { content: [{ type: "text", text: JSON.stringify({ timezone }, null, 2) }] }; }
- src/index.ts:172-180 (registration)Tool registration in the listTools handler. Defines the tool name, description, and input schema (empty object, no parameters required).{ name: "getTimezone", description: "获取当前设备的时区信息", inputSchema: { type: "object", properties: {}, required: [] } },
- src/index.ts:175-179 (schema)Input schema for the getTimezone tool, which requires no parameters (empty object).inputSchema: { type: "object", properties: {}, required: [] }