Skip to main content
Glama

page_expectData

Assert that a specific data path on the current page deeply equals an expected value. Detects missing paths versus undefined values to prevent silent failures.

Instructions

一次性断言当前页面某个 data 路径的值是否与 expected 深度相等。expected 为必填——省略会抛错(早期省略会让缺失路径与 undefined 误判为相等而静默判过,故强制传)。返回 {pass,expected,actual,pathResolved,snapshot:{path}}:读 pass;pathResolved(=actual 是否 !==undefined) 用来区分「路径不存在」与「值确实是 undefined」。对象键插入顺序不影响比较结果。结果超过 maxBytes(默认 50000B)会截断。path 为单条点/方括号路径(如 user.profile.namelist[0].id),不支持 page_getData 的 [*] 通配投影。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
expectedYes
maxBytesNo
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。
Behavior4/5

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

No annotations present, but description thoroughly explains return value structure, path resolution behavior, truncation at maxBytes, and object key order insensitivity. Also mentions error case for omitted expected.

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 dense with relevant information, front-loaded with purpose, and each sentence adds value. Slightly long but efficient given 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?

No output schema, but description fully explains return object fields (pass, expected, actual, pathResolved, snapshot). Covers all parameters, error handling, comparison behavior, and truncation. Well-rounded 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 low (25%) but description compensates by explaining path (single, no wildcard), expected (required, deep equality), maxBytes (default 50000), and connection (optional override with field details).

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 the tool performs a one-time assertion on a data path value using deep equality. It distinguishes itself from siblings like page_getData (retrieval) and other page_expect* tools by focusing on data path assertion.

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?

Provides context on required expected parameter and why (previous silent failures), and specifies path format limitations. However, it lacks explicit guidance on when to use this tool vs alternatives like page_getData for inspection.

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