Skip to main content
Glama

调用 wx API

wdt_wx_method

Invoke WeChat Mini Program wx APIs such as getSystemInfoSync or getStorageSync and return their results for automation and runtime data retrieval.

Instructions

通过 miniProgram.callWxMethod 调用 wx 方法,并返回结果。例如 getSystemInfoSync、getStorageSync。

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "method": "<method>"
    },
    "name": "wdt_wx_method"
  }
}

Input Schema

NameRequiredDescriptionDefault
argsNo
methodYeswx 方法名,如 getSystemInfoSync

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.2

TDQS

C2.8/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full burden. It states only that a result is returned; it omits prerequisites (does it need a connected/logged-in session, an open project, a current page?), the sync/async distinction implied by the sync examples, error behavior for unsupported methods, and what form the returned value takes.

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?

Two short, front-loaded sentences with no filler, and the mechanism is stated before the examples. It is efficient, though the brevity is closer to under-specification than to tight writing.

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 two-parameter tool with no output schema and no annotations, the definition tells an agent what it does but not enough to call it confidently. The `args` contract and the environment preconditions are the missing pieces that matter most for an arbitrary-API passthrough.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 50%: only `method` is documented in the schema, and the description merely repeats that with the same example. The `args` array — the non-obvious part, where arguments are passed positionally to the target wx method — is left completely unexplained in both schema and description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

It names a concrete verb and mechanism: invoke a wx method through miniProgram.callWxMethod and return the result, with concrete examples (getSystemInfoSync, getStorageSync). An agent can tell this is a generic escape hatch into the mini-program wx API, but the description never contrasts it with dedicated siblings such as wdt_system_info, which would answer the same question for at least one example.

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?

There is no guidance on when to reach for this generic passthrough versus a purpose-built sibling, and no indication of which wx methods are supported or under what conditions the call will fail. Usage must be inferred entirely from the examples given.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.