Skip to main content
Glama

Export standalone signer

mp_sandbox_export

Exports a self-contained Node.js signing script from a WeChat Mini Program sandbox by tracing signing-function dependencies and generating a minimal .mjs file independent of wx-sandbox/app-service.js.

Instructions

从沙箱导出独立 Node.js 签名脚本。追踪签名函数的依赖模块,提取最小子集,生成不依赖 wx-sandbox / app-service.js 的自包含 .mjs 文件。流程:加载 bundle → 运行 verify 验证签名能跑通 → 追踪依赖 → 生成独立脚本。需要先 mp_analyze 解包 + mp_sandbox_run 确认签名函数路径。

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": {
      "appid": "<appid>",
      "entry": "<entry>"
    },
    "name": "mp_sandbox_export"
  }
}

Input Schema

NameRequiredDescriptionDefault
fnNo要导出的函数名 (如 'sign'),不填则 export default 整个模块
appidYes小程序 appid
entryYes签名模块路径 (如 'npm/some-sdk/index.js')
outputNo输出文件路径 (默认 static/out/<appid>/signer.mjs)
verifyNo验证代码 (如 "requireMod('npm/sdk').sign({ts:1})"),确保签名能跑通
storageNo预设 wx storage JSON

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.3

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the burden and does well: it discloses the internal pipeline (load bundle → run verify → trace dependencies → generate the standalone script) and that a file is written to a path. It omits failure semantics, e.g. whether a failed verify aborts generation or whether an existing output file is overwritten.

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?

Front-loaded with the outcome, then prerequisites; every sentence is substantive. The dependency-tracing step is stated twice (once in the mechanism sentence, again in the flow sequence), which is minor redundancy but keeps the definition readable.

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?

For a complex code-generation tool with six parameters and no output schema, the description supplies the pipeline, the prerequisite tools, and the default output location. The remaining gap is failure/overwrite behavior, which matters for a tool that writes .mjs files.

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 description coverage is 100%, so every parameter is already documented in the schema, giving a baseline of 3. The description adds the concept of the verify step and dependency tracing but no syntax or format detail beyond what the schema already conveys.

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?

States a specific verb and artifact: export a standalone Node.js signing script (.mjs) that does not depend on wx-sandbox/app-service.js. The mechanism (trace the signing function's dependency modules, extract the minimal subset, generate a self-contained file) makes it unmistakably different from mp_sandbox_run or mp_sandbox_modules.

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?

Explicitly names the prerequisite sequence: mp_analyze to unpack plus mp_sandbox_run to confirm the signing function path before exporting. That is real when-to-use routing to specific siblings. It does not say when not to use it (e.g. plain sandbox execution without export), so it falls short of a 5.

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