Skip to main content
Glama

wechat_create_jsapi_order

Create a WeChat Pay V3 JSAPI order for WeChat or mini-program payments, returning prepay_id and the parameters needed to invoke wx.invoke('getBrandWCPayRequest') for payment.

Instructions

微信支付V3 JSAPI 下单(微信内/小程序):返回 prepay_id 与 wx.invoke("getBrandWCPayRequest") 调起参数。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
credNo凭证(可省略,改用环境变量;PEM 字段可直接传 PEM 全文或 .pem 文件路径)
orderYes
openidYes
executeNo
notifyUrlYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.2/5.0
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions it 'returns prepay_id' and 'invoke parameters', but does not disclose that it actually initiates a payment order with WeChat, which has side effects (e.g., creating an unpaid order, potential charges). It doesn't mention authentication requirements, the need for valid credentials, or the fact that the tool makes a network call. The description lacks behavioral transparency for a mutation-like operation.

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 sentence that is concise and front-loads the core action (WeChat Pay V3 JSAPI order) and key output (prepay_id and invoke parameters). It is not verbose, but it lacks additional structured information that would be helpful, like usage examples or key parameter clarifications. It is appropriately sized but could be improved with more details without becoming wordy.

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?

Given the tool's complexity (5 parameters, nested objects, no output schema, no annotations), the description is incomplete. It does not explain the purpose of each parameter, the required format of the 'order' object (e.g., amountFen in fen), or the meaning of 'execute' (whether it actually sends the request). It does not describe the return structure or error handling. The description leaves significant gaps that an agent would need to infer.

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?

The schema description coverage is only 20%, meaning the schema itself does not describe most parameters. The description mentions returning prepay_id and invoke parameters, but does not explain the meaning of 'order', 'openid', 'notifyUrl', or the optional 'execute' flag. It does not clarify that 'openid' is the user's WeChat OpenID required for JSAPI, or the role of 'notifyUrl'. The description adds minimal value beyond the schema's field names.

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 specifies the tool's purpose: creating a JSAPI order for WeChat Pay V3, targeting WeChat in-app or mini-program environments, and returning both prepay_id and the parameters for wx.invoke('getBrandWCPayRequest'). This is specific with verb and resource, and it distinguishes itself from siblings like wechat_create_native_order (which is for Native payments) and alipay_precreate (Alipay).

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

Usage Guidelines3/5

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

The description implies usage context (WeChat in-app/mini-program) but does not explicitly state when to use this tool versus alternatives like wechat_create_native_order, which is for QR code payments. It does not mention that this requires an openid (user authorization) or that it is not for Alipay. The usage guidance is implied but not fully explicit.

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