{"record":{"id":"37480bae47a39de2","repo":"flipped-aurora/gin-vue-admin","slug":"userrequirement","errorCode":null,"errorMessage":"参数错误：userRequirement 必须提供","messagePattern":"参数错误：userRequirement 必须提供","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/mcp/gva_review.go","lineNumber":65,"sourceCode":"**重要提示：**\n- 本工具只产出引导 prompt，不执行任何代码修改，也不替代 AI 的实际分析`),\n\t\tmcp.WithString(\"userRequirement\",\n\t\t\tmcp.Description(\"经过requirement_analyze处理后的用户需求描述，包含详细的功能要求和字段信息\"),\n\t\t\tmcp.Required(),\n\t\t),\n\t\tmcp.WithString(\"generatedFiles\",\n\t\t\tmcp.Description(\"gva_execute创建的文件列表，JSON字符串格式，包含所有生成的后端和前端文件路径\"),\n\t\t\tmcp.Required(),\n\t\t),\n\t)\n}\n\n// Handle 处理审查请求\nfunc (g *GVAReviewer) Handle(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) {\n\t// 获取用户需求\n\tuserRequirementData, ok := request.GetArguments()[\"userRequirement\"]\n\tif !ok {\n\t\treturn nil, errors.New(\"参数错误：userRequirement 必须提供\")\n\t}\n\n\tuserRequirement, ok := userRequirementData.(string)\n\tif !ok {\n\t\treturn nil, errors.New(\"参数错误：userRequirement 必须是字符串类型\")\n\t}\n\n\t// 获取生成的文件列表\n\tgeneratedFilesData, ok := request.GetArguments()[\"generatedFiles\"]\n\tif !ok {\n\t\treturn nil, errors.New(\"参数错误：generatedFiles 必须提供\")\n\t}\n\n\tgeneratedFilesStr, ok := generatedFilesData.(string)\n\tif !ok {\n\t\treturn nil, errors.New(\"参数错误：generatedFiles 必须是JSON字符串\")\n\t}\n","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/flipped-aurora/gin-vue-admin/blob/3136500ef380842b0eb6c4daa87c3f8a47fcf9e0/server/mcp/gva_review.go#L47-L83","documentation":"The GVAReviewer MCP tool's Handle method requires a 'userRequirement' argument describing the user's requirement for the code review. If request.GetArguments() has no 'userRequirement' key, it returns this error immediately before any review work begins. It is a hard input contract of the tool: the review prompt cannot be generated without the requirement text.","triggerScenarios":"Calling the gva_review MCP tool via mcp.CallToolRequest without including 'userRequirement' in the tool arguments map.","commonSituations":"An MCP client sends an empty or partially-populated arguments object; the caller omits the argument because it assumed defaults; a tool-schema mismatch where the client and server disagree on required parameters.","solutions":["Add 'userRequirement' (a non-empty string) to the tool call arguments.","Check the MCP tool schema advertised by the server and make the client send all required arguments.","If calling programmatically, populate request params via the standard MCP arguments structure rather than a raw map.","Verify argument key spelling matches exactly: 'userRequirement' (camelCase)."],"exampleFix":"// before\nargs := map[string]any{\"generatedFiles\": \"[]\"}\n// after\nargs := map[string]any{\n  \"userRequirement\": \"实现用户管理模块\",\n  \"generatedFiles\": \"[\\\"server/api/user.go\\\"]\",\n}","handlingStrategy":"validation","validationCode":"args := request.GetArguments()\nv, ok := args[\"userRequirement\"]\nif !ok || v == nil || v == \"\" {\n    return nil, errors.New(\"userRequirement must be a non-empty string before calling gva_review\")\n}","typeGuard":"func asString(v any) (string, bool) {\n    s, ok := v.(string)\n    return s, ok && s != \"\"\n}","tryCatchPattern":null,"preventionTips":["Always build the tool arguments from a checked struct, not an ad-hoc map.","Keep the MCP tool inputSchema in sync with the client so required fields are enforced upstream.","Log the outgoing arguments object during development to catch omissions early."],"tags":["mcp","validation","go","missing-argument"],"backgroundTag":"missing-required-parameter","analyzedSha":"3136500ef380842b0eb6c4daa87c3f8a47fcf9e0","analyzedAt":"2026-08-31T13:50:02.721Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}