Skip to main content
Glama

页面快照

web_snapshot

Capture a structured accessibility snapshot of the current page, listing interactive elements with reference numbers for precise targeting by click and fill tools.

Instructions

生成当前页面的无障碍树快照:包含标题、URL 与带引用编号(ref)的元素树。交互元素(按钮/链接/输入框等)带 [编号] 前缀,后续 web_click / web_fill 等工具可用该编号定位。快照只包含结构化信息,不包含像素图像。

权限说明:只读操作,不产生网络请求;快照内容仅返回给调用方。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorNo只快照该选择器命中的子树
max_depthNo树的最大深度,默认 8
max_nodesNo节点总数上限,默认 600
Behavior5/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It explicitly states it is a read-only operation, makes no network requests, and that the snapshot content is only returned to the caller. It also clarifies the output is structured data and not pixels, providing critical safety and expectation 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 concise and well-structured, with the main function front-loaded in the first sentence, followed by usage context, content clarification, and permission note. Every sentence adds essential value without unnecessary filler.

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?

Given there is no output schema, the description explains the return content (title, URL, element tree with refs) and how refs are used. It covers permission and content type. It could mention truncation behavior from max_nodes/max_depth or error cases, but the schema already covers limits, making this sufficiently complete.

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?

The input schema already provides 100% coverage with descriptions for all three optional parameters (selector, max_depth, max_nodes). The tool description does not add any additional parameter-specific meaning, so it stays at the baseline without enhancing beyond the schema.

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 clearly states it generates an accessibility tree snapshot of the current page with title, URL, and element tree with refs. It distinguishes itself from siblings like web_screenshot by explicitly noting it contains structured information, not pixel images, and from web_status by focusing on interactive element positioning.

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?

The description provides clear context by stating that the refs can be used by subsequent web_click / web_fill tools, implying when to use it. It also contrasts with pixel images, separating it from screenshot usage, though it does not explicitly list when not to use it or name alternative tools.

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/JohnXu22786/browser-automation'

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