Skip to main content
Glama

snapshot

Read-only

Captures the current tab's accessibility tree, tagging interactive elements with [ref=eN] IDs for click and type tools; re-run after page changes or scope by ref/depth on large pages.

Instructions

获取当前标签页的页面结构快照(可访问性树)。每个可交互元素带 [ref=eN],click/type 等工具通过 ref 指定元素。页面变化后旧 ref 可能失效,需要重新 snapshot。页面很大时可用 ref 只取某个区域、用 depth 限制层级。

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": "snapshot"
  }
}

Input Schema

NameRequiredDescriptionDefault
refNo只取这个元素及其内部(来自之前快照的 ref)
depthNo限制层级深度,用于先看页面大致结构

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.1/5.0
Behavior4/5

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

With readOnlyHint and openWorldHint already declared, the description adds genuinely new behavioral context: refs are ephemeral and invalidated by page changes, and calls can be scoped to a subtree. It does not mention whether the snapshot itself mutates state or how a missing/invalid ref is reported, which keeps it below a 5.

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?

Four short sentences, purpose front-loaded, followed by the ref contract, the invalidation caveat, and the scoping options in descending order of importance. Dense but every sentence carries information; the ordering could put the invalidation warning slightly earlier, but nothing is wasteful.

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 read-only inspection tool with no output schema and two fully documented optional parameters, the description covers what the output looks like (accessibility tree with [ref=eN] markers) and the lifecycle of those refs. The only gap is a lack of detail on what a scoped or depth-limited snapshot omits.

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% and both parameters carry their own descriptions, including the exact "来自之前快照的 ref" semantics and the depth upper bound. The description's parameter sentence largely restates the schema, so the baseline 3 is appropriate rather than higher.

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 a specific verb and resource ("获取当前标签页的页面结构快照(可访问性树)") and immediately explains the key output artifact ([ref=eN]), which is exactly what an agent needs to know. Naming click/type as the consumers of refs distinguishes it from siblings without ambiguity.

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?

It gives a clear condition for re-running ("页面变化后旧 ref 可能失效,需要重新 snapshot") and describes when to narrow scope with ref/depth for large pages. It stops short of naming an alternative tool (e.g. find or read_text) for the case where you want text rather than structure, so the sibling routing is implicit.

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