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

  1. After page discovery, a route extraction pipeline parses all discovered URLs and groups them into normalized patterns.
  2. Dynamic segments (e.g. /products/:slug) are identified and parameterized; static segments remain literal.
  3. Routes are organized into a parent-child tree reflecting the URL hierarchy.
  4. 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

ParameterTypeRequiredDescription
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

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.

Tips

Run after discover_all_pages completes — route patterns are extracted automatically during discovery.
The tree structure maps directly to file-system-based routing in Next.js, Nuxt, or SvelteKit.
is_dynamic=true routes need a dynamic page component or catch-all route in your clone.
Use include_pages=true to see exactly which pages fall under each route — useful for verifying pattern accuracy.
Combine with get_page_templates to see which template each route uses.

Related Tools