Skip to main content

url_decode

Decode a percent-encoded URL string back to plain text. Follows RFC 3986 — %XX sequences are converted to the corresponding UTF-8 characters.

Parameters​

ParameterTypeRequiredDescription
inputstringYesThe percent-encoded string to decode (e.g. "hello%20world" → "hello world").

Response​

FieldTypeDescription
decodedstringDecoded plain-text string.

Examples​

Input:

{
"input": "hello%20world"
}

Result:

{
"decoded": "hello world"
}

Input (query parameter values):

{
"input": "key%3Dvalue%26other%3Dx"
}

Result:

{
"decoded": "key=value&other=x"
}

Input (Unicode):

{
"input": "h%C3%A9llo"
}

Result:

{
"decoded": "héllo"
}

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_argumentsAn argument is missing or the wrong type.protocol error (invalid_params)
invalid_percent_encodingThe input contains a malformed %XX sequence — the two digits are not valid hex (e.g. %GG) or the escape is truncated — or the decoded bytes are not valid UTF-8 (e.g. a lone high byte like %80).tool error (isError)
internal_errorAn unexpected server error.protocol error (internal_error)

Notes​

  • This tool follows RFC 3986 percent-decoding. The + character is not decoded as a space — that convention belongs to application/x-www-form-urlencoded. A literal + in the input remains a + in the output.
  • To encode a string, use url_encode.