flipped-aurora/gin-vue-admin · error

参数错误:executionPlan 必须提供

Error message

参数错误:executionPlan 必须提供

What it means

GVAExecutor.Handle is the MCP tool handler for executing a code-generation plan. It reads the `executionPlan` argument from the incoming CallToolRequest via request.GetArguments(); if the argument map has no such key, it returns immediately with this error. The library requires every tool invocation to carry the full plan JSON, so a missing argument aborts before any parsing or validation happens.

Source

Thrown at server/mcp/gva_execute.go:218

								},
							},
						},
					},
				},
			}),
			mcp.AdditionalProperties(false),
		),
		mcp.WithString("requirement",
			mcp.Description("原始需求描述(可选,用于日志记录)"),
		),
	)
}

// Handle 处理执行请求(移除确认步骤)
func (g *GVAExecutor) Handle(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) {
	executionPlanData, ok := request.GetArguments()["executionPlan"]
	if !ok {
		return nil, errors.New("参数错误:executionPlan 必须提供")
	}

	// 解析执行计划
	planJSON, err := json.Marshal(executionPlanData)
	if err != nil {
		return nil, fmt.Errorf("解析执行计划失败: %v", err)
	}

	var plan ExecutionPlan
	err = json.Unmarshal(planJSON, &plan)
	if err != nil {
		return nil, fmt.Errorf("解析执行计划失败: %v\n\n请确保ExecutionPlan格式正确,参考工具描述中的结构体格式要求", err)
	}

	// 验证执行计划的完整性
	if err := g.validateExecutionPlan(ctx, &plan); err != nil {
		return nil, fmt.Errorf("执行计划验证失败: %v", err)
	}

View on GitHub (pinned to 3136500ef3)

Solutions

  1. Add `executionPlan` to the tool call arguments with the complete plan object.
  2. Check the argument key spelling: it must be exactly `executionPlan` (camelCase), not `execution_plan` or `plan`.
  3. Verify the MCP client serializes the full argument map (log request.GetArguments() to confirm what the server receives).
  4. Ensure the plan object is not undefined/null at the call site before invoking the tool.

Example fix

// before
callTool("gva_execute", {})

// after
callTool("gva_execute", {
  executionPlan: {
    packageName: "my-plugin",
    packageType: "plugin",
    needCreatedPackage: true,
    packageInfo: { /* ... */ }
  }
})
Defensive patterns

Strategy: validation

Validate before calling

function validateToolArgs(args) {
  if (args == null || !('executionPlan' in args) || args.executionPlan == null) {
    throw new Error('gva_execute requires an executionPlan argument');
  }
  return true;
}
// call: validateToolArgs(toolArgs); await callTool('gva_execute', toolArgs);

Type guard

function hasExecutionPlan(args) {
  return args != null && typeof args === 'object' && 'executionPlan' in args && args.executionPlan != null && typeof args.executionPlan === 'object';
}

Try / catch

try {
  const result = await callTool('gva_execute', { executionPlan: plan });
} catch (err) {
  if (String(err.message).includes('executionPlan 必须提供')) {
    // retry with the plan attached
    return callTool('gva_execute', { executionPlan: buildPlan() });
  }
  throw err;
}

Prevention

When it happens

Trigger: Calling the MCP tool without including the `executionPlan` key in the tool arguments — e.g. an empty argument object, a client-side typo like `execution_plan`, or the plan variable being undefined so it was dropped from the serialized arguments.

Common situations: MCP client misconfiguration where tool input schema is not enforced; an LLM agent invoking the tool with only partial arguments; hand-written test invocations omitting the argument; client library versions that strip undefined/null argument values during JSON serialization.

Related errors


AI-assisted analysis of flipped-aurora/gin-vue-admin@3136500ef3 (2026-08-31). Data as JSON: /api/errors/4b1435efab62eea7. Report an issue: GitHub.