Skip to main content

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​

ParameterTypeRequiredDescription
inputstringYesThe UTF-8 string to hash.

Response​

FieldTypeDescription
hashstringLowercase 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).

CodeWhenDelivered as
invalid_argumentsThe input field is missing or not a string.protocol error (invalid_params)
internal_errorAn 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, or hash_blake3.