timestamp
Retrieve the current UTC timestamp to synchronize time-sensitive operations in your applications.
Instructions
Get the current UTC timestamp
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:20-28 (handler)The handler function that executes the 'timestamp' tool logic. It takes no input parameters and returns the current UTC time as an ISO string via new Date().toISOString().
// Example tool: get current timestamp server.tool( "timestamp", "Get the current UTC timestamp", {}, async () => ({ content: [{ type: "text", text: new Date().toISOString() }], }) ); - src/index.ts:24-24 (schema)Input schema for the 'timestamp' tool - an empty object `{}`, meaning the tool takes no parameters.
{}, - src/index.ts:21-28 (registration)Registration of the 'timestamp' tool via server.tool() with name 'timestamp', description 'Get the current UTC timestamp', empty input schema, and the handler function.
server.tool( "timestamp", "Get the current UTC timestamp", {}, async () => ({ content: [{ type: "text", text: new Date().toISOString() }], }) );