feat: add React getTree agent tool#304
Merged
Merged
Conversation
Expose a paginated React tree tool with depth and subtree scoping for agent workflows.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Document the new React agent tree lookup.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is this?
This PR adds a
getTreetool to the built-in React agent domain so agents can fetch the current React component hierarchy in one call. It fills the gap between broadsearchNodesqueries and node-by-node traversal withgetChildren.How does it work?
The React tree store now exposes a paginated tree traversal that can start from all current roots or from a specific root node. Callers can limit traversal depth, page through larger trees with the existing cursor format, and receive each item with its node summary, child IDs, and depth. The tool is registered in the middleware React domain, added to the SDK static tool list, and documented in the Rozenite agent skill reference.
Why is this useful?
Agents can quickly understand the shape of a running app before inspecting props, state, hooks, or children. The new tool reduces the number of calls needed for common React debugging workflows while keeping the existing granular tools unchanged.