get_tree tool returns the entire GrapesJS component hierarchy as a recursive JSON tree starting from the canvas root. Each node in the tree carries the component’s ID, HTML tag, applied classes, HTML attributes, text content, and an array of child nodes. Your agent can traverse this tree to understand the current layout, identify components by their attributes or classes, and determine which IDs to pass to write tools like update_styles or delete_nodes.
For large canvases with many components, use depth to limit how many levels the response includes, or use artboardId to scope the tree to a single artboard frame.
Parameters
number
Maximum nesting depth to include in the response. A value of
1 returns only the root and its direct children. Omit this parameter to receive the full tree with no depth limit.string
If provided, the tree is scoped to the artboard with this ID rather than the entire canvas root. Obtain artboard IDs from
list_artboards.Response
object | null
required
The root
ComponentNode of the canvas or scoped artboard. Returns null if the canvas has no components.Example
response
Component IDs like
"comp-hero" are stable within a canvas session but are regenerated when a canvas is re-imported from HTML. Always re-fetch the tree if your agent performs a bulk import before targeting specific components.