Skip to main content
Glama
yfmeii

WeChat Mini Program Dev MCP

by yfmeii

mp_callWx

Execute WeChat Mini Program API methods to automate development tasks, enabling AI assistants to interact with and control mini program components through the miniprogram-automator interface.

Instructions

调用微信小程序 API 方法。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
connectionNo
methodYes
argsNo

Implementation Reference

  • The execute handler for the 'mp_callWx' tool. It parses input arguments, invokes the miniProgram.callWxMethod with the specified method and args, formats the result, and returns it as text content.
    execute: async (rawArgs, context: ToolContext) => {
      const args = callWxMethodParameters.parse(rawArgs ?? {});
      return manager.withMiniProgram<ContentResult>(
        context.log,
        { overrides: args.connection },
        async (miniProgram) => {
          const callArgs = args.args ?? [];
          const result = await miniProgram.callWxMethod(
            args.method,
            ...callArgs
          );
          return toTextResult(
            formatJson({
              method: args.method,
              arguments: callArgs,
              result: toSerializableValue(result),
            })
          );
        }
      );
    },
  • Zod schema defining the input parameters for the 'mp_callWx' tool: connection (from common), required method string, and optional array of arguments.
    const callWxMethodParameters = connectionContainerSchema.extend({
      method: z.string().trim().min(1),
      args: z.array(z.unknown()).optional(),
    });
  • The tool object definition and registration within createCallWxMethodTool function, specifying name 'mp_callWx', description, parameters schema, and execute handler.
    return {
      name: "mp_callWx",
      description: "调用微信小程序 API 方法。",
      parameters: callWxMethodParameters,
      execute: async (rawArgs, context: ToolContext) => {
        const args = callWxMethodParameters.parse(rawArgs ?? {});
        return manager.withMiniProgram<ContentResult>(
          context.log,
          { overrides: args.connection },
          async (miniProgram) => {
            const callArgs = args.args ?? [];
            const result = await miniProgram.callWxMethod(
              args.method,
              ...callArgs
            );
            return toTextResult(
              formatJson({
                method: args.method,
                arguments: callArgs,
                result: toSerializableValue(result),
              })
            );
          }
        );
      },
    };
  • Registration of the mp_callWx tool by including it in the array returned by createApplicationTools.
    createCallWxMethodTool(manager),
  • src/tools.ts:9-9 (registration)
    Top-level registration where application tools, including mp_callWx, are composed into the full tools array.
    ...createApplicationTools(manager),
Behavior1/5

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

No annotations are provided, so the description must fully disclose behavioral traits. It only states the action ('call API methods') without any details on side effects, permissions, error handling, or expected outcomes. For a tool with complex connection parameters and no output schema, this is critically insufficient.

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, efficient sentence in Chinese with no wasted words. It is front-loaded and appropriately sized for its minimal content, though this conciseness comes at the cost of completeness.

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

Completeness1/5

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

Given the tool's complexity (3 parameters with nested objects, no annotations, no output schema), the description is completely inadequate. It fails to explain the tool's role among siblings, parameter usage, behavioral implications, or return values, leaving the agent unable to use it effectively.

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

Parameters1/5

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

Schema description coverage is 0%, so the description must compensate by explaining parameters. It adds no meaning beyond the schema, failing to clarify the purpose of 'connection', 'method', or 'args', or how they interact. With 3 parameters (including a nested object with 12 properties), this gap is severe.

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

Purpose2/5

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

The description '调用微信小程序 API 方法' (Call WeChat Mini Program API methods) restates the tool name 'mp_callWx' with minimal elaboration. It provides a general verb ('call') and resource ('WeChat Mini Program API methods'), but lacks specificity about what types of API methods or what distinguishes it from siblings like 'page_callMethod' or 'element_callMethod'. This is borderline tautological.

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

Usage Guidelines1/5

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

No guidance is provided on when to use this tool versus alternatives. With multiple sibling tools involving method calls (e.g., 'page_callMethod', 'element_callMethod'), the description fails to differentiate use cases, prerequisites, or exclusions. This leaves the agent without context for tool selection.

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/yfmeii/weapp-dev-mcp'

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