generateUuid
Generate timestamp-based UUID v7 identifiers for chronological sorting and guaranteed uniqueness without requiring input parameters.
Instructions
Generate a UUID v7 that's timestamp-based and guaranteed to be unique
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:40-52 (handler)Executes the generateUuid tool by generating a UUID v7 using the uuidv7 function and returning it as text content in the response.if (request.params.name === "generateUuid") { // UUID v7 is timestamp-based with additional random data for uniqueness const uuid = uuidv7(); return { content: [ { type: "text", text: uuid } ] }; }
- src/index.ts:18-34 (registration)Registers the tools/list request handler, which advertises the generateUuid tool including its name, description, and input schema.server.setRequestHandler( ListToolsRequestSchema, async () => { return { tools: [ { name: "generateUuid", description: "Generate a UUID v7 that's timestamp-based and guaranteed to be unique", inputSchema: { type: "object", properties: {} } } ] }; } );
- src/index.ts:26-29 (schema)Defines the input schema for the generateUuid tool as an empty object (no input parameters required).inputSchema: { type: "object", properties: {} }
- src/index.ts:4-4 (helper)Imports the UUID v7 generator function (uuidv7) used in the tool handler.import { v7 as uuidv7 } from 'uuid';