Skip to main content
Glama

element_query

Find the first child element matching a WXSS selector within a specified element in a WeChat mini-program. Use element_id and selector to locate the target child element.

Instructions

在元素内按 WXSS 选择器查询首个匹配子元素

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYesWXSS 选择器
element_idYes
Behavior2/5

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

With no annotations, the description carries full behavioral disclosure. It only states the query scope and match criteria, but omits critical behavior such as what happens when no match is found, whether it performs a read-only operation, or the return format. This is insufficient for a resource query tool.

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?

A single concise sentence that is front-loaded with the action verb '查询' and includes all key scoping information (within element, WXSS selector, first match). No redundant words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

This simple tool has only 2 parameters and no output schema, but the description still feels incomplete. It fails to state what the query returns (e.g., the element ID of the matched child) or any error behavior. Given the tool's simplicity, a more complete description is expected.

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 'selector' parameter with a description, but 'element_id' lacks any description. The tool description adds context by indicating '在元素内' (within element), subtly explaining that element_id identifies the parent element and clarifying the relationship between parameters. However, it does not fully compensate for the missing element_id schema description, so it is adequate but not excellent.

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's function: '查询首个匹配子元素' (query the first matching child element) using a WXSS selector, with an explicit scope '在元素内' (within an element). It distinguishes from the sibling 'element_query_all' by specifying '首个' (first match).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No when-to-use guidance or comparison with alternatives is provided. It implies usage for querying a single child element, but does not explicitly contrast with element_query_all or page_query tools, leaving selection criteria ambiguous.

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