Skip to main content
Glama

element_getInnerElements

Query child elements within a located element using a target selector. Returns an array of element summaries with index, count, and totalCount. Optionally includes outerWxml.

Instructions

在一个已定位元素的范围内查询子元素数组(element.$$(targetSelector)),返回 {count,totalCount,limited,elements[]},每个元素含摘要(tagName/text/value/size/offset)及其数组 index。limit 默认/最大 100,避免一次汇总全部子元素卡住连接;totalCount 是总命中数,count 是实际返回数。用法:selector(+可选 innerSelector)定位作用域元素,targetSelector 是在该作用域内执行的查询。withWxml=true 额外返回每个元素的完整 outerWxml。结果超过 maxBytes(默认 50000B)返回截断包装。selector 支持 [index=N](仅作用于 selector,innerSelector/targetSelector 内不支持下标)。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
maxBytesNo
selectorYes
withWxmlNo
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。
innerSelectorNo
targetSelectorYes
Behavior4/5

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

With no annotations, the description carries full burden. It discloses the return structure (count, totalCount, limited, elements[]), default/max limit (100), truncation via maxBytes, optional withWxml, and selector index support. It omits stating that the operation is read-only (though implied) and does not mention error conditions, but covers key behavioral traits.

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?

The description is a single paragraph that efficiently packs purpose, return structure, defaults, and constraints. It is front-loaded with the main action. Some structuring (e.g., bullet points for parameters) could improve scanability, but it is not overly verbose and every sentence adds value.

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?

Given the complexity (7 params, no output schema, no annotations), the description provides substantial information about return structure, limits, and selector behavior. It lacks details on error handling or empty results, but it is sufficient for an agent to select and invoke the tool correctly in most cases.

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?

Schema description coverage is only 14% (connection only), so the description must compensate. It explains the purpose and interplay of selector, targetSelector, innerSelector, limit, maxBytes, and withWxml. It provides defaults and restrictions not in schema. This fully compensates for the low 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 retrieves an array of child elements within a positioned element using a selector, returns a structured result with count and summary details. It distinguishes itself from the sibling tool 'element_getInnerElement' (singular) by focusing on multiple elements, and from other element tools by specifying the query mechanism (element.$$).

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 explains the usage pattern: using selector and optional innerSelector to locate the scope, then targetSelector to query children. It also notes restrictions like [index=N] only for selector. However, it does not explicitly compare to alternatives like page_getElements or state when not to use this tool, but the context is adequate for most scenarios.

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