generate_uuid7s
Generate a specified number of UUIDv7 identifiers for unique data tracking or system integration. Set the count parameter to customize output as needed.
Instructions
Generates a specified number of UUIDv7 (default is 1).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | No | The number of UUIDs to generate |
Implementation Reference
- server.py:23-30 (registration)Registers the 'generate_uuid7s' tool using @mcp.tool decorator. Includes input schema via Annotated Field and a thin wrapper that delegates to the implementation function.@mcp.tool( name="generate_uuid7s", description="Generates a specified number of UUIDv7 (default is 1).", ) def generate_uuid7s( count: Annotated[int, Field(description="The number of UUIDs to generate", default=1, ge=1)], ) -> list[str]: return generate_uuid7s_impl(count)
- tools/generate_uuid_tool.py:7-19 (handler)The core handler function that implements the tool logic by generating the specified number of UUID version 7 using the uuid6 library.def generate_uuid7s_impl( count: Annotated[int, Field(description="The number of UUIDs to generate", default=1, ge=1)], ) -> list[str]: """ Generates a specified number of UUIDv7. Args: count: The number of UUIDs to generate. Defaults to 1. Must be 1 or greater. Returns: A list of UUIDv7 strings. """ return [str(uuid6.uuid7()) for _ in range(count)]