get_time
Retrieve the current time for applications requiring accurate timestamp data in development workflows.
Instructions
Get the current time
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": "get_time"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/server.ts:129-139 (handler)The main handler function for the 'get_time' tool. It retrieves the current date and time using new Date() and formats it as an ISO string in the MCP tool response format.
private handleGetTime() { const now = new Date() return { content: [ { type: 'text', text: `Current time: ${now.toISOString()}`, }, ], } } - src/server.ts:41-48 (schema)The tool schema definition including name, description, and empty input schema (no parameters required). This is part of the TOOLS array used for tool listing.
{ name: 'get_time', description: 'Get the current time', inputSchema: { type: 'object', properties: {}, }, }, - src/server.ts:86-87 (registration)Registration of the tool handler in the switch statement within the CallToolRequestSchema request handler, dispatching calls to 'get_time' to the handleGetTime method.
case 'get_time': return this.handleGetTime()