Skip to main content
Glama

element_set_data

Set data for a custom component in a WeChat mini-program by specifying its element ID and the data object. Enables programmatic modification of component state for automated testing.

Instructions

修改自定义组件 data(仅自定义组件可用)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYes要改变的数据对象,仅自定义组件可用
element_idYes
Behavior2/5

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

No annotations are provided, so the description must carry the full burden. It only states that it modifies data and is restricted to custom components; it does not disclose whether the data object is merged or replaced, whether side effects occur, or error behavior. This is minimal for a mutation 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?

The description is a single, front-loaded sentence with no filler. It communicates the action and the main constraint efficiently.

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?

The tool has two required params and no output schema or annotations. The description covers the core purpose and restriction but omits behavioral details such as merge semantics, response, and prerequisites like how to get element_id. It is adequate for a simple setter but not fully complete.

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?

Schema coverage is 50%: the 'data' parameter has a description, but 'element_id' does not. The tool description adds the context that the data belongs to a custom component, which helps infer element_id's purpose, but does not explain how to obtain it or the expected format beyond the schema.

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 uses a specific verb '修改' (modify) and resource '自定义组件 data' (custom component data), and explicitly states the constraint '仅自定义组件可用' (only custom components). This clearly differentiates it from sibling tools like element_data (getter) and page_set_data.

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 provides clear context: this tool is for modifying data on custom components only. It states an exclusion ('仅自定义组件可用') but does not explicitly name alternatives for non-custom elements. This is sufficient guidance for selection in most cases.

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