hash_md5
Compute the MD5 (128-bit) hash of a UTF-8 string. Returns a 32-character lowercase hexadecimal digest.
warning
MD5 is cryptographically broken and must not be used for security-sensitive purposes such as digital signatures or password hashing. It is provided here for compatibility with legacy systems, file checksums, ETags, and protocols that still require MD5.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | Yes | The UTF-8 string to hash. |
Response
| Field | Type | Description |
|---|---|---|
hash | string | Lowercase hexadecimal digest. |
Examples
Hash a non-empty string
{
"input": "hello world"
}
Result:
{
"hash": "5eb63bbbe01eeed093cb22bb8f5acdc3"
}
Hash an empty string
The MD5 digest of the empty string is a well-known constant and a useful baseline for verifying tool output:
{
"input": ""
}
Result:
{
"hash": "d41d8cd98f00b204e9800998ecf8427e"
}
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 | The input field is missing or not a string. | protocol error (invalid_params) |
internal_error | An unexpected server error. | protocol error (internal_error) |
Notes
- The input is always treated as a UTF-8 string. If you need to hash raw bytes, hex-encode them first.
- The digest is always 32 lowercase hex characters (128 bits).
- MD5 output is deterministic — the same input always produces the same digest.
- For new applications requiring a secure hash, prefer
hash_sha256,hash_sha512, orhash_blake3.