Redirect trace
Trace one URL through every redirect instead of checking only the final response. This makes loops, long chains and a surprising destination hard to miss.
Install and run the tool
Install the CLI once, then run seo start to connect your site and Google data. After setup you can run this tool yourself or ask your agent to run it.
Install the SEO CLI globally.
npm i -g seoRun setup after installation.
seo startFollow every redirect hop to the final page.
seo redirect-trace --url https://example.com/old-pageWhat the tool gives you
Follow every redirect hop from one URL to its final page and check status codes, loops, chains, canonicals and link safety before updating links.
- Best for
- A migrated, shortened, or legacy URL behaves unexpectedly.
- Needs
- Live URL responses
- You get
- Follow every redirect hop from one URL to its final page and check status codes, loops, chains, canonicals and link safety before updating links.
- Use next
- Recover broken URLs with search value
Every report follows the same rules for missing data and outside estimates.See how report data works.
What you need before you run it
The report uses the information below. Optional sources are only used when you ask for them.
Live URL responses
Provides each status, location header, hop, final URL, and transport failure.
Final page evidence
Adds the final response, canonical, robots directives, title, and content type.
Use a different report for these jobs
These jobs need a different report or a manual review.
Use the tool with an agent or in code
The command above is enough for most work. These options let an agent, script or application run the same tool with explicit input and structured output.
CLI
Use the report catalog when an agent, script or CI job needs predictable JSON instead of the normal terminal output. Check the current input first, then run the tool with the validated parameters.
Check the current input before the agent or script runs the tool.
seo reports describe redirect-trace --jsonOnce the input is valid, run the tool through the report catalog.
seo reports run redirect-trace --params '{"url":"https://example.com/old-page","maxHops":8,"refresh":true}' --jsonMCP
An MCP agent follows the same two-step flow. It inspects the current schema, fills the required fields and only then runs the tool.
Ask the MCP server for the current tool input.
{
"id": "redirect-trace"
}Run the tool after the agent has checked and filled the input.
{
"id": "redirect-trace",
"params": {
"url": "https://example.com/old-page",
"maxHops": 8,
"refresh": true
}
}TypeScript
Install the package in a Node 22 project when your application needs to run the tool directly. The result includes the same evidence, warnings and limits returned through the CLI and MCP server.
Add the SEO package to your project.
npm install seoRun the tool from your TypeScript application.
import { executeReport } from 'seo/mcp'
const result = await executeReport(
'redirect-trace',
{
"url": "https://example.com/old-page",
"maxHops": 8,
"refresh": true
},
)
console.log(result)What to do next
Fix loops, unnecessary hops and destinations that do not match the original URL's purpose. Update internal links to the final URL and trace the path again after deployment.
- 01Update internal links to the final destination.
- 02Use link recovery to find other search-visible broken URLs.
Related reports
Find broken URLs and weak redirects that still have Search Console value, then decide which pages to restore, redirect or leave alone using search evidence.
Audit one URL for technical SEO, metadata, canonicals, schema, links and Search Console queries. See the live evidence before changing the page.
Check sitemap URL status, redirects and access first. Run the full technical SEO crawl only when you need page content, links, metadata and affected URLs.
Sources used by this tool
These primary sources define the provider data or search controls used by the result.