get_route_patterns Architecture
Get the URL routing structure discovered for a cloning job
Overview
Part of the Architecture Toolkit. After pages are discovered, DoneDone.Run extracts and normalizes URL route patterns — static paths, dynamic segments, nested hierarchies, and page counts per route. This tool returns the full routing tree so you can understand the site's URL structure and design matching routes for your clone. Optionally include linked pages per route for full page-to-route traceability.
How It Works
- After page discovery, a route extraction pipeline parses all discovered URLs and groups them into normalized patterns.
- Dynamic segments (e.g. /products/:slug) are identified and parameterized; static segments remain literal.
- Routes are organized into a parent-child tree reflecting the URL hierarchy.
- This tool returns the tree with page counts per route. Pass include_pages=true to also get the list of pages linked to each route.
Input Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
job_id |
string |
required | Cloning job ID |
include_pages |
boolean |
optional | When true, each route includes a pages array with linked pages (page_id, source_url, title). Default false. |
pages_per_route_limit |
number |
optional | Maximum pages to return per route when include_pages is true. Default 100, hard ceiling 10000. |
What You Get Back
- total_routes — number of unique route patterns discovered
- total_pages_linked — total pages across all routes
- routes — hierarchical tree of route nodes
- For each route: id, full_pattern, is_dynamic, depth, description, example_path, page_count
- children — nested child routes reflecting URL hierarchy
- pages — linked page list (page_id, source_url, title) when include_pages is true
- pages_truncated — true when page_count exceeds pages_per_route_limit
Example Use Case
An agent calls get_route_patterns to learn the site has 12 route patterns: a static home (/), a dynamic product detail (/products/:slug with 47 pages), a blog index (/blog/), and dynamic post (/blog/:slug with 23 pages). The agent maps these directly to Next.js file-based routing conventions.
