generateUUID
Generate random UUIDs for unique identifiers in applications using crypto.randomUUID().
Instructions
Generate a random UUID using crypto.randomUUID()
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/generator.ts:19-26 (handler)The handler function that executes the generateUUID tool logic, calling randomUUID() and returning the result in MCP content format.handler: async () => { return { content: [{ type: 'text', text: randomUUID() }] }; }
- src/tools/generator.ts:15-18 (schema)Input schema for the generateUUID tool, specifying an empty object (no input parameters required).inputSchema: { type: 'object', properties: {} },
- src/tools/generator.ts:12-27 (registration)Full definition of the generateUUID tool within generatorTools export, including name, description, schema, and handler.generateUUID: { name: 'generateUUID', description: 'Generate a random UUID using crypto.randomUUID()', inputSchema: { type: 'object', properties: {} }, handler: async () => { return { content: [{ type: 'text', text: randomUUID() }] }; } },
- src/index.ts:32-32 (registration)Registers generatorTools (including generateUUID) by spreading it into the allTools object used by the MCP server for tool listing and execution....generatorTools,
- src/tools/generator.ts:1-1 (helper)Imports the randomUUID utility from Node.js crypto module used in the generateUUID handler.import { randomUUID } from 'node:crypto';