time
Get current time with optional timezone specification. Returns the current time for any specified IANA timezone, defaulting to Asia/Seoul.
Instructions
현재 시각을 반환합니다. 타임존을 지정할 수 있습니다.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| timezone | No | IANA 타임존 (기본값: Asia/Seoul) | Asia/Seoul |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | 현재 시각 |
Implementation Reference
- src/index.ts:117-159 (handler)Tool 'time' definition and handler registration.
server.registerTool( 'time', { description: '현재 시각을 반환합니다. 타임존을 지정할 수 있습니다.', inputSchema: z.object({ timezone: z .string() .optional() .default('Asia/Seoul') .describe('IANA 타임존 (기본값: Asia/Seoul)') }), outputSchema: z.object({ content: z .array( z.object({ type: z.literal('text'), text: z.string().describe('현재 시각') }) ) .describe('현재 시각') }) }, async ({ timezone }) => { let text: string try { const now = new Date() text = new Intl.DateTimeFormat('ko-KR', { timeZone: timezone, dateStyle: 'full', timeStyle: 'long' }).format(now) } catch { throw new Error('유효하지 않은 타임존입니다.') } return { content: [{ type: 'text' as const, text }], structuredContent: { content: [{ type: 'text' as const, text }] } } } )