timestamp
Retrieve current timestamps in ISO, Unix, or human-readable formats for time-sensitive operations and data synchronization.
Instructions
Get current timestamp
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | Format: "iso" (default), "unix", or "human" |
Implementation Reference
- plugins/utils.js:69-82 (handler)The execute handler for the 'timestamp' tool, which generates the current timestamp in the requested format: 'unix' (seconds since epoch), 'human' (locale string), or 'iso' (ISO string, default).async execute(args) { const { format = 'iso' } = args; const now = new Date(); switch (format) { case 'unix': return { timestamp: Math.floor(now.getTime() / 1000) }; case 'human': return { timestamp: now.toLocaleString() }; case 'iso': default: return { timestamp: now.toISOString() }; } }
- plugins/utils.js:60-68 (schema)Input schema for the 'timestamp' tool defining the optional 'format' parameter.inputSchema: { type: 'object', properties: { format: { type: 'string', description: 'Format: "iso" (default), "unix", or "human"' } } },
- plugins/utils.js:58-83 (registration)The 'timestamp' tool definition within the utils plugin's tools object, which serves as its registration point for the plugin manager.timestamp: { description: 'Get current timestamp', inputSchema: { type: 'object', properties: { format: { type: 'string', description: 'Format: "iso" (default), "unix", or "human"' } } }, async execute(args) { const { format = 'iso' } = args; const now = new Date(); switch (format) { case 'unix': return { timestamp: Math.floor(now.getTime() / 1000) }; case 'human': return { timestamp: now.toLocaleString() }; case 'iso': default: return { timestamp: now.toISOString() }; } } },