getTimezone
Retrieve the current timezone of a device using this tool to ensure accurate time-based operations and synchronization within the operating environment.
Instructions
获取当前设备的时区信息
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"required": [],
"type": "object"
}
Implementation Reference
- src/index.ts:600-608 (handler)The execution handler for the 'getTimezone' tool. It 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)The tool registration entry in the listTools response, defining the name, description, and input schema (empty object) for 'getTimezone'.{ name: "getTimezone", description: "获取当前设备的时区信息", inputSchema: { type: "object", properties: {}, required: [] } },
- src/index.ts:175-179 (schema)The input schema for the 'getTimezone' tool, which requires no parameters.inputSchema: { type: "object", properties: {}, required: [] }