Skip to main content
Glama

analyzePage

Analyze the current page to produce a structured tree of its elements, metadata, and groups, enabling state tracking and element identification for automated browser interaction.

Instructions

PRIMARY tool for reading page state. Returns APOM tree: {tree, metadata, groups}. Compact format (default): containers as "tag_id":[children] keys, interactive elements as {id, tag, type, position, metadata} without selectors. Use element IDs (e.g., button_45, input_20) with click/type tools. Selectors registered internally for resolution. Use refresh:true after clicks. Efficient: 8-10k tokens vs screenshot 15-25k. Legend: clickTarget format is "tag:id" (e.g., "kp-chats-list-item:container_58") - use the id part for clicking. No clickTarget = element handles its own click.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
diffNoReturn only changes since last analysis: {added, removed, changed} (default: false).
groupByNoGroup elements: 'type' or 'flat' (default: 'type')
refreshNoRefresh cache (default: false)
includeAllNoInclude all elements with selectors - full debug format (default: false for compact format)
viewportOnlyNoOnly analyze elements in current viewport (default: false). Reduces output for long pages.
includePortalsNoInclude React Portal contents — menus, tooltips, popovers outside main root (default: true). Without this, dropdown items are invisible.
portalSelectorsNoCustom portal root CSS selectors. Default: ['#modal-root', '#menu-popup-root', '#tooltip-root', '#popover-root', '[data-portal]'].
useLegacyFormatNoReturn legacy format instead of APOM (default: false - APOM is now default)
registerElementsNoAuto-register elements in selector resolver (default: true)
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden. It discloses the return format (APOM tree), compact vs full format, internal selector registration, cache refresh requirement, token efficiency, and clickTarget legend. It doesn't discuss potential errors or side effects, but as a read tool this is reasonably transparent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is dense but well-structured, front-loading the core purpose. Every sentence provides useful information (format, IDs, refresh, efficiency, legend). It's longer than typical, but the content earns its place given the tool's complexity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 9 parameters and no output schema, the description explains the return structure, element ID usage, refresh semantics, and format options. It gives enough context for an agent to use it effectively. Minor gaps exist around error behavior and full debug format details, but overall it's complete enough.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3. The description adds some context beyond the schema (e.g., refresh after clicks, compact format), but doesn't need to re-explain parameters since the schema already documents them effectively.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states 'PRIMARY tool for reading page state' with a specific verb and resource, and distinguishes it from sibling tools like screenshot and getElementDetails. It clearly conveys the tool's role and scope.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides clear context on when to use (primary read tool), and includes actionable guidance like 'Use refresh:true after clicks' and using element IDs with click/type tools. It does not explicitly name alternatives or when-not-to-use, but the 'PRIMARY' positioning and efficiency note imply the intended usage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/docentovich/chrometools-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server