uuid_generate_v3
Generate a deterministic UUID v3 using the MD5 hash of a namespace UUID and a name string. The same namespace and name always produce the same UUID, making v3 suitable for deriving stable identifiers from well-known strings.
For new applications prefer uuid_generate_v5, which uses SHA-1 and is more collision-resistant than MD5.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
namespace | string | Yes | Namespace to use: "dns", "url", "oid", "x500", or "custom". |
name | string | Yes | The name string to hash (e.g. a domain name, URL, or other identifier). |
custom_namespace | string | Yes (when namespace is "custom") | A valid UUID string to use as the namespace (e.g. "550e8400-e29b-41d4-a716-446655440000"). |
Standard namespaces
| Value | Namespace UUID | Intended use |
|---|---|---|
"dns" | 6ba7b810-9dad-11d1-80b4-00c04fd430c8 | Domain names |
"url" | 6ba7b811-9dad-11d1-80b4-00c04fd430c8 | URLs |
"oid" | 6ba7b812-9dad-11d1-80b4-00c04fd430c8 | ISO Object Identifiers |
"x500" | 6ba7b814-9dad-11d1-80b4-00c04fd430c8 | X.500 Distinguished Names |
Response
| Field | Type | Description |
|---|---|---|
uuids | array of strings | A single-element array containing the generated UUID. |
version | string | Always "v3". |
Examples
Generate a v3 UUID from a domain name
{
"namespace": "dns",
"name": "example.com"
}
Result:
{
"uuids": ["9073926b-929f-31c2-abc9-fad77ae3e8eb"],
"version": "v3"
}
Generate a v3 UUID with a custom namespace
{
"namespace": "custom",
"custom_namespace": "550e8400-e29b-41d4-a716-446655440000",
"name": "my-resource-id"
}
Result:
{
"uuids": ["d19ab338-d71d-3424-a3fa-5a266c792023"],
"version": "v3"
}
Errors
Each failure carries a precise code in the response. Argument-schema and server errors are JSON-RPC protocol errors; a rejected value is returned as a tool result with isError: true (so the agent can read the code and self-correct).
| Code | When | Delivered as |
|---|---|---|
invalid_arguments | namespace or name is missing, or an argument is the wrong type. | protocol error (invalid_params) |
missing_custom_namespace | custom_namespace is missing when namespace is "custom". | tool error (isError) |
invalid_uuid | custom_namespace is not a valid UUID string. | tool error (isError) |
internal_error | An unexpected server error. | protocol error (internal_error) |
Notes
- The result is always a single-element array.
- Calling this tool twice with the same inputs always returns the same UUID.
- v3 and v5 produce different UUIDs for identical inputs because they use different hash algorithms.