Skip to content

Accessibility tree/snapshot for a specific DOM element, including whole hierarchy below it (custom "root" element) #716

@BogdanCerovac

Description

@BogdanCerovac

Is your feature request related to a problem? Please describe.

With #363, we have the possibility to extract the whole structure and whole structure alone.

This is great, but can also cause context "overflows" or extreme token usage for complex pages where we perhaps just wanted to check a specific element or a sub-tree of specific elements.

Describe the solution you'd like

As discussed in #363 (comment)

To make things flexible and effective, I suggest to have the possibility to "extract" only a sub-tree, based on a specific root element that I can define.

For example - if I want to just get the navigation and not the whole page, I could use the nav#main-nav or just #main-nav as a root and the MCP would return nav all elements under it.

That would help me to isolate the results when needed and saved on time, tokens and other resources.

Describe alternatives you've considered

Surely, we can post-process the whole tree after it is extracted. But that means that we always use a lot of time and tokens and can sometimes get to the limits of context window etc. Especially for smaller LLMs.

Additional context

In my experience, as a developer, I often work on components in isolation and less in the context of a full page. This means that getting whole tree all of the time is wasting time and resources and making me less effective.

I guess that most of developers work more on single components than on whole pages, so I think that having the isolated results for a specific component is way more effective. Especially on larg(er) sites with lots of components.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions