current_time
Retrieve the current date and time for accurate timestamping or synchronization needs using Simple MCP Server's built-in tool. Ideal for applications requiring precise time data.
Instructions
Get the current date and time
Input Schema
TableJSON 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(), returns formatted current time in 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 defining empty input object for current_time tool.const CurrentTimeArgsSchema = z.object({});
- src/index.ts:80-87 (registration)Registration of 'current_time' tool in listTools response with name, description, and empty input schema.{ name: 'current_time', description: 'Get the current date and time', inputSchema: { type: 'object', properties: {}, }, },