get_nav_structure Architecture
Get the navigation structure extracted from shared UI elements
Overview
Part of the Architecture Toolkit. Returns the navigation structure extracted from shared UI elements for a clone job — nav trees for main navigation, footer links, and sidebar menus. Each node in the tree includes a label, URL, sort order, and nested children, giving you the full link hierarchy needed to rebuild navigation components in your clone.
How It Works
- During shared element analysis, navigation elements (main nav, footer nav, sidebar nav) are identified and their link structures extracted.
- Links are organized into named nav groups: 'main', 'footer', or 'sidebar'.
- Parent-child relationships are preserved to represent nested dropdown menus and link hierarchies.
- This tool returns the nav tree for the job, optionally filtered to a specific nav group.
Input Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
job_id |
string |
required | Cloning job ID |
nav_group |
string |
optional | Filter by nav group: 'main', 'footer', or 'sidebar' |
What You Get Back
- nav_group_filter — the filter applied (or null for all groups)
- total_items — total navigation items across all groups
- groups — list of nav groups found (e.g. ['main', 'footer'])
- nav_tree — hierarchical tree of nav items
- For each nav item: id, label, url, nav_group, sort_order, children
Example Use Case
An agent calls get_nav_structure with nav_group='main' to get the full main navigation tree: Home, Products (with 3 dropdown children: All Products, Categories, On Sale), Blog, and Contact. It uses this to build the clone's navigation component with the exact same link hierarchy.
Tips
Run after a full comparison completes — nav structure is extracted as part of shared element analysis.
Use nav_group filter to focus on just the main nav, footer, or sidebar independently.
Children arrays represent dropdown menus and nested link groups — preserve nesting when building your component.
URLs in nav items are source site URLs — apply your clone domain substitution when wiring up links.
If nav_tree is empty, shared element detection may not have found navigation elements — check get_shared_page_elements for 'navigation' type elements.
