current_time
Retrieve the current date and time for timestamping events, scheduling tasks, or checking system time.
Instructions
Get the current date and 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": "current_time"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:148-159 (handler)Handler for the 'current_time' tool: validates args with schema, creates new Date(), and returns formatted current time as text content.
case 'current_time': { CurrentTimeArgsSchema.parse(args); const now = new Date(); return { content: [ { type: 'text', text: `Current date and time is from my Simple MCP Server:=>: ${now.toLocaleString()}`, }, ], }; } - src/index.ts:37-37 (schema)Zod schema definition for 'current_time' tool arguments (empty object since no input required).
const CurrentTimeArgsSchema = z.object({}); - src/index.ts:80-87 (registration)Tool registration in ListTools response: defines name, description, and JSON input schema (empty object).
{ name: 'current_time', description: 'Get the current date and time', inputSchema: { type: 'object', properties: {}, }, },