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
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | Yes | The percent-encoded string to decode (e.g. "hello%20world" → "hello world"). |
Response
| Field | Type | Description |
|---|---|---|
decoded | string | Decoded 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).
| Code | When | Delivered as |
|---|---|---|
invalid_arguments | An argument is missing or the wrong type. | protocol error (invalid_params) |
invalid_percent_encoding | The 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_error | An 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 toapplication/x-www-form-urlencoded. A literal+in the input remains a+in the output. - To encode a string, use
url_encode.