Skip to main content
Glama
emadklenka

mare-browser-mcp

by emadklenka

browser_snapshot

Capture a snapshot of the page's interactive elements with stable refs, so automation can reliably click, fill, and inspect without fragile CSS selectors.

Instructions

Return the accessibility tree of the current page with refs attached to interactive elements (buttons, links, textboxes, checkboxes, etc.). Use this INSTEAD of guessing CSS selectors from a screenshot — selectors break on class-name churn, refs don't.

Returns { url, snapshot: [...tree], refs: [{ref, selector, role, name, testId}, ...] }.

Each ref like "e9" maps internally to a stable selector. Pass refs to browser_act: browser_act({ commands: [ { action: "fill", ref: "e42", value: "user@example.com" }, { action: "click", ref: "e9" } ]})

Every node includes testId when the element has data-testid, data-test, or data-qa — use these as additional stability anchors. Refs are invalidated automatically on navigation — re-snapshot after any browser_navigate or URL change.

Use compact: true to drop pure layout wrappers (divs/spans with no role, no testId) and return a flatter tree focused on interactive content. Recommended for noisy apps with deeply-nested div soup.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
compactNoDrop non-semantic wrapper elements (divs/spans without role or testId). Flattens noisy trees.
max_depthNoMax tree depth (default: 10)
Behavior5/5

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

With no annotations, the description carries the full burden and delivers. It discloses the return format, that refs map internally to stable selectors, that they invalidate on navigation, and that testId is included when present. It also explains the effect of compact:true on the tree. This is rich behavioral context.

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

Conciseness5/5

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

The description is structured with a clear purpose, return type, usage example, and edge-case notes (ref invalidation, compact). It is front-loaded with the key action and uses concise bullet-like prose; every sentence adds distinct value.

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

Completeness5/5

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

As there is no output schema, the description must and does explain the return shape, ref semantics, and the recommended companion tool (browser_act). It also covers navigation invalidation and parameter behavior, making it complete for a tool of this complexity.

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

Parameters4/5

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

Schema coverage is 100% with both compact and max_depth described. The description adds practical guidance for compact—'to drop pure layout wrappers (divs/spans with no role, no testId)' and 'Recommended for noisy apps with deeply-nested div soup'—extending beyond the schema's descriptor. max_depth remains schema-only, but the additional compact context justifies a score above baseline.

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 opens with 'Return the accessibility tree of the current page with refs attached to interactive elements,' a specific verb+resource that clearly states what the tool does. It also differentiates from siblings by explicitly advising to use it INSTEAD of guessing CSS selectors from a screenshot, distinguishing it from browser_screenshot.

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

Usage Guidelines5/5

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

Explicitly states 'Use this INSTEAD of guessing CSS selectors from a screenshot' and explains that refs are stable while selectors break on class-name churn. It also instructs to pass refs to browser_act and notes that refs invalidate after navigation, providing clear when-to-use context. This is explicit guidance beyond simple purpose.

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/emadklenka/mare_browser_mcp'

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