test_redirect
Test a path against a site's live redirect rules to see which rule matches and where visitors are sent, or check draft rules and _redirects text before saving or deploying. Nothing is saved.
Instructions
Test a path against a site's redirect rules, as the site would answer it: the rule that matches, with its status and the location visitors are sent to, or match: null when the path is served as is. Tests the live rules by default. To check a change before saving or deploying it, pass draftRules to test in place of the saved user rules, or draftText to test in place of the live deploy's _redirects. A draft's errors are listed by index or line, and its valid rules are still tested. Nothing is saved.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"siteId": "<siteId>",
"path": "<path>"
},
"name": "test_redirect"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | The path to test, starting with `/`, with an optional query string, such as `/old-page?ref=mail`. | |
| siteId | Yes | The site ID (from `list_sites`). | |
| draftText | No | `_redirects` text to test in place of the live deploy's file. | |
| partition | No | Data partition the site lives in. Omit to use the user's home partition. | |
| draftRules | No | User rules to test in place of the saved ones. |