Skip to main content
Glama

page_query_xpath_all

Retrieve all matching elements from a page via XPath, obtaining element handles for automated interaction. Handles are limited to the last 1000 when results exceed that count.

Instructions

在页面中按 XPath 表达式查询所有匹配元素(返回 element_id 句柄数组;超 1000 个时仅末尾 1000 个句柄可用)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xpathYesXPath 表达式
page_idYes
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses the return type (array of element_id handles) and an important behavioral limit: when more than 1000 matches, only the last 1000 handles are available. This adds meaningful context about the operation's cap, though it does not cover error cases or handle lifetime.

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 a single, well-structured sentence that front-loads the core function (query all matching elements by XPath) and appends the critical return/limit behavior. There is no redundancy or wasted words.

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?

For a simple query tool with no output schema, the description covers the main behavior and the 1000-handle limit, which is useful. However, it does not explain what happens when there are no matches, whether the page must be active, or how the returned handles are used, leaving gaps for an AI agent.

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 schema covers the xpath parameter with a description, and the tool description repeats 'XPath expression'. The phrase 'in the page' indirectly implies the page_id parameter refers to the target page, but no additional syntax or type details are provided. This is a modest compensation for the 50% schema coverage.

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 the tool queries all matching elements by XPath in the page, using specific verbs and resources. It also distinguishes from siblings by including 'all' and the XPath method, and specifying the return of element_id handle arrays.

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 gives clear context that this tool is for querying all XPath matches, which differentiates it from singular XPath queries. However, it does not explicitly mention alternatives or when not to use it, so it lacks active exclusions.

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/pureia/wechat-devtools-mcp'

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