Skip to main content

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​

ParameterTypeRequiredDescription
namespacestringYesNamespace to use: "dns", "url", "oid", "x500", or "custom".
namestringYesThe name string to hash (e.g. a domain name, URL, or other identifier).
custom_namespacestringYes (when namespace is "custom")A valid UUID string to use as the namespace (e.g. "550e8400-e29b-41d4-a716-446655440000").

Standard namespaces​

ValueNamespace UUIDIntended use
"dns"6ba7b810-9dad-11d1-80b4-00c04fd430c8Domain names
"url"6ba7b811-9dad-11d1-80b4-00c04fd430c8URLs
"oid"6ba7b812-9dad-11d1-80b4-00c04fd430c8ISO Object Identifiers
"x500"6ba7b814-9dad-11d1-80b4-00c04fd430c8X.500 Distinguished Names

Response​

FieldTypeDescription
uuidsarray of stringsA single-element array containing the generated UUID.
versionstringAlways "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).

CodeWhenDelivered as
invalid_argumentsnamespace or name is missing, or an argument is the wrong type.protocol error (invalid_params)
missing_custom_namespacecustom_namespace is missing when namespace is "custom".tool error (isError)
invalid_uuidcustom_namespace is not a valid UUID string.tool error (isError)
internal_errorAn 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.