Skip to main content
Glama

page_snapshot

Capture a lightweight snapshot of the current page, including route, query, data paths, and key selector elements. Use it to probe the DOM and state when page content is unknown.

Instructions

返回当前页面的轻量结构快照,聚合 route、query、指定 data 路径、关键选择器的元素摘要。最适合「不确定页面上有什么」时探查 DOM/状态(page_waitElement 超时排查也会指向它)。返回 {route,query,selectors,elementCount,elementsLimited,processedSelectorCount,elementSummaryLimit,elements:[{selector,index,tagName,text,value,size,offset}],data?,hint?}。⚠️ 不传 selectors/dataPaths/withData 时只返回 route——这不代表页面为空,会附 hint 提示补参。withData=true 会把整棵 data 树塞进 data['$'](token 炸弹,大对象改用 dataPaths 按字段投影)。limit 默认 10,限制每个 selector 返回的元素数;所有 selector 合计最多汇总 100 个元素摘要,达到上限时 elementsLimited=true。整个快照超过 maxBytes(默认 50000B)返回 truncated 包装。单个已知字段用 page_getData,单个元素用 page_getElement。对自定义组件同样默认不穿透(取决于 styleIsolation/addGlobalClass)。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
maxBytesNo
withDataNo
withWxmlNo
dataPathsNo
selectorsNo
connectionNo可选连接覆盖(不传则用默认会话)。可用字段:mode(launch|connect)、cliPath、projectPath、wsEndpoint、timeout、port(【自动化端口】→ cli auto --auto-port,默认 9420;不是 IDE HTTP 服务端口,别把 IDE 服务端口传进来)、account、ticket、trustProject、args、cwd、autoClose、autoLaunch、launchTimeout、connectTimeout。
withElementsNo
Behavior5/5

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

Without annotations, description fully discloses behaviors: empty args return only route with hint, withData token bomb, default limits, maxBytes truncation, custom component handling, and return structure. No contradictions.

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?

Description is long but efficient, front-loading purpose. Could be slightly more structured (e.g., bullet points) but every sentence adds value. Very concise given the complexity.

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?

Given 8 parameters, nested objects, no output schema, and no annotations, the description covers essential behaviors, edge cases (empty args, limits, truncation), and alternatives. Highly complete.

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

Parameters5/5

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

Despite low schema description coverage (13%), description adds meaning to all key parameters: explains limit, withData, dataPaths, selectors, maxBytes, and their effects. Compensates fully.

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?

Description clearly states it returns a lightweight structural snapshot of the current page, aggregating route, query, data paths, and element summaries. Distinguishes from siblings by mentioning alternatives like page_getData and page_getElement for specific use cases.

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 when to use: '最适合「不确定页面上有什么」时探查 DOM/状态(page_waitElement 超时排查也会指向它).' Also provides alternatives: '单个已知字段用 page_getData,单个元素用 page_getElement.'

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/Chaixueyuan/weapp-agent-mcp'

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