time
Retrieve the current time from the TypeScript MCP Server Boilerplate to synchronize applications or timestamp events.
Instructions
현재 시간을 반환합니다.
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": "time"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| unixMs | Yes | Unix epoch milliseconds | |
| content | Yes | ||
| isoTime | Yes | ISO 8601 형식 현재 시간 |
Implementation Reference
- src/index.ts:117-158 (handler)The 'time' tool registration and handler implementation.
server.registerTool( 'time', { description: '현재 시간을 반환합니다.', inputSchema: z.object({}), outputSchema: z.object({ content: z.array( z.object({ type: z.literal('text'), text: z.string().describe('현재 시간 메시지') }) ), isoTime: z.string().describe('ISO 8601 형식 현재 시간'), unixMs: z.number().describe('Unix epoch milliseconds') }) }, async () => { const now = new Date() const isoTime = now.toISOString() const unixMs = now.getTime() const message = `현재 시간: ${isoTime}` return { content: [ { type: 'text' as const, text: message } ], structuredContent: { content: [ { type: 'text' as const, text: message } ], isoTime, unixMs } } } )