Skip to main content
Glama
agent-browser-mcp

agent-browser-mcp

by zy2755

browser_snapshot

Capture a semantic snapshot of the current browser page to identify interactive elements with [eN] refs for reliable AI-driven actions. Limit output by selector, rootRef, or interactive filter.

Instructions

获取当前页面语义快照:交互元素带 [eN] ref 编号(iframe 内容已拍平)。支持 rootRef(只看某元素子树)、selector、filter:"interactive" 只看交互元素。

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "browser_snapshot"
  }
}

Input Schema

NameRequiredDescriptionDefault
filterNo
rootRefNo只快照该 ref 元素的子树
selectorNo只快照匹配该 CSS 选择器的子树(主文档)
maxElementsNo最多输出行数(默认 400)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations supplied, the description carries the full burden, and it does disclose two real behavioral traits: iframe contents are flattened into the output, and interactive elements are annotated with [eN] refs. It omits other behavior an agent would want — whether the snapshot is strictly read-only, how truncation behaves when maxElements is exceeded, and what the non-interactive 'balanced'/'text' modes actually return. Useful additions, but not a complete behavioral picture.

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 core purpose and the distinguishing ref behavior are front-loaded in the first clause, with scoping options following in a compact parenthetical. No filler sentences, though the run-together enumeration of rootRef/selector/filter is slightly dense to parse.

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

Completeness3/5

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

There is no output schema and no annotations, so the description must cover the return shape — it partially does by describing [eN] refs and iframe flattening. However, it leaves unexplained what 'balanced' and 'text' output looks like and how truncation is signaled for a large page, gaps an agent will hit on complex pages. Reasonable but not complete for a four-parameter, schema-less tool.

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 description coverage is 75%, so the schema already explains rootRef, selector, and maxElements. The description adds meaning to only one parameter, clarifying that filter:"interactive" restricts output to interactive elements, but it says nothing about the 'balanced' and 'text' enum values or the default filter mode, and does not restate the default 400-line cap. Marginal value beyond the schema.

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

Purpose4/5

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

The description names a specific operation and resource ('获取当前页面语义快照') and adds the defining trait that distinguishes it from siblings like browser_screenshot: it returns a semantic structure with [eN] ref numbers, not an image. The iframe-flattening note further pins down what kind of snapshot this is. It stops short of naming a sibling to contrast with explicitly, so a 4 rather than a 5.

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

Usage Guidelines3/5

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

Usage is only implied: the mention of [eN] refs suggests this is the tool to call before browser_click/browser_type, and the filter options hint at scoping choices, but the description never states when to choose this over browser_screenshot or browser_get_info, nor any prerequisite such as needing a page loaded first. Adequate context, no explicit when/when-not guidance.

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