Skip to main content
Glama

generateUuid

Generate timestamp-based UUID v7 identifiers for chronologically sortable unique IDs. Specify count parameter to create multiple identifiers at once.

Instructions

Generate one or more UUID v7s (timestamp-based). Specify count to get multiple.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
countNoHow many UUID v7 strings to generate (defaults to 1)

Implementation Reference

  • Handler logic for the generateUuid tool: extracts count from arguments (default 1), generates that many UUID v7s using uuidv7(), and returns them as newline-separated text content.
    if (request.params.name === "generateUuid") { // Pull from params.arguments per MCP spec const raw = request.params.arguments?.count; const count = typeof raw === "number" && raw >= 1 ? raw : 1; const uuids: string[] = []; for (let i = 0; i < count; i++) { uuids.push(uuidv7()); } return { content: [ { type: "text", text: uuids.join("\n") } ] }; }
  • Input schema definition for generateUuid tool: object with optional 'count' integer property (min 1).
    inputSchema: { type: "object", properties: { count: { type: "integer", minimum: 1, description: "How many UUID v7 strings to generate (defaults to 1)" } }, additionalProperties: false }
  • src/index.ts:14-37 (registration)
    Registers the generateUuid tool by handling ListToolsRequest and returning the tool metadata including name, description, and inputSchema.
    server.setRequestHandler( ListToolsRequestSchema, async () => { return { tools: [ { name: "generateUuid", description: "Generate one or more UUID v7s (timestamp-based). Specify `count` to get multiple.", inputSchema: { type: "object", properties: { count: { type: "integer", minimum: 1, description: "How many UUID v7 strings to generate (defaults to 1)" } }, additionalProperties: false } } ] }; } );
  • Imports the uuidv7 function used to generate UUIDs in the handler.
    import { v7 as uuidv7 } from "uuid";

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/prazedotid/uuid-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server