generate_uuid
Generate a random UUID v4 using a secure Node.js crypto module. Ideal for creating unique identifiers in applications and systems efficiently.
Instructions
Generate a random UUID v4
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The generateUuidHandler function implements the core logic: generates a random UUID v4 using Node.js crypto.randomUUID() and returns it formatted as MCP tool result content.export const generateUuidHandler = async ( _request: CallToolRequest ): Promise<CallToolResult> => { const uuid = randomUUID(); return { content: [ { type: 'text', text: uuid } ] }; };
- The toolSpec defines the tool's name, description, and input schema (empty object since no parameters required).export const toolSpec = { name: 'generate_uuid', description: 'Generate a random UUID v4', inputSchema: { type: 'object' as const, properties: {}, } };
- src/index.ts:19-19 (registration)Registers the generate_uuid tool handler in the MCP server registry for 'tools/call' operations.registry.register('tools/call', 'generate_uuid', generateUuidHandler as Handler);