{"record":{"id":"732d43f99fc8108d","repo":"flipped-aurora/gin-vue-admin","slug":"description","errorCode":null,"errorMessage":"description 参数是必需的","messagePattern":"description 参数是必需的","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/mcp/api_creator.go","lineNumber":79,"sourceCode":"\t)\n}\n\nfunc (a *ApiCreator) Handle(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) {\n\targs := request.GetArguments()\n\n\tvar apis []ApiCreateRequest\n\tif apisStr, ok := args[\"apis\"].(string); ok && apisStr != \"\" {\n\t\tif err := json.Unmarshal([]byte(apisStr), &apis); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"apis 参数格式错误: %w\", err)\n\t\t}\n\t} else {\n\t\tpath, ok := args[\"path\"].(string)\n\t\tif !ok || path == \"\" {\n\t\t\treturn nil, errors.New(\"path 参数是必需的\")\n\t\t}\n\t\tdescription, ok := args[\"description\"].(string)\n\t\tif !ok || description == \"\" {\n\t\t\treturn nil, errors.New(\"description 参数是必需的\")\n\t\t}\n\t\tapiGroup, ok := args[\"apiGroup\"].(string)\n\t\tif !ok || apiGroup == \"\" {\n\t\t\treturn nil, errors.New(\"apiGroup 参数是必需的\")\n\t\t}\n\n\t\tmethod := \"POST\"\n\t\tif value, ok := args[\"method\"].(string); ok && value != \"\" {\n\t\t\tmethod = value\n\t\t}\n\n\t\tapis = append(apis, ApiCreateRequest{\n\t\t\tPath:        path,\n\t\t\tDescription: description,\n\t\t\tApiGroup:    apiGroup,\n\t\t\tMethod:      method,\n\t\t})\n\t}","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/flipped-aurora/gin-vue-admin/blob/3136500ef380842b0eb6c4daa87c3f8a47fcf9e0/server/mcp/api_creator.go#L61-L97","documentation":"Thrown by ApiCreator's Handle when the \"description\" argument is missing, empty, or not a string in single-API mode. The description documents the API being created and is mandatory for the generated ApiCreateRequest.","triggerScenarios":"Invoking the api_creator tool with \"path\" and \"apiGroup\" set but no \"description\" string, or description = \"\" or a non-string value.","commonSituations":"Agents generating tool calls that skip the description field; frontend forms submitting blank descriptions; clients assuming description is optional.","solutions":["Add a non-empty \"description\" string argument describing the API's purpose.","Use the bulk \"apis\" JSON argument (each entry still needs a description field).","Check upstream code that builds the arguments map for a dropped/renamed description key."],"exampleFix":"// before\n{\"arguments\": {\"path\": \"/user/list\", \"apiGroup\": \"user\"}}\n// after\n{\"arguments\": {\"path\": \"/user/list\", \"description\": \"获取用户列表\", \"apiGroup\": \"user\"}}","handlingStrategy":"validation","validationCode":"const description = args[\"description\"]\nif (typeof description !== \"string\" || description === \"\") {\n  throw new Error(\"description must be a non-empty string before calling api_creator\")\n}","typeGuard":"function hasDescription(args) {\n  return typeof args.description === \"string\" && args.description.length > 0\n}","tryCatchPattern":"try {\n  await callTool(\"api_creator\", { path, description, apiGroup })\n} catch (e) {\n  if (e.message.includes(\"description 参数是必需的\")) {\n    // supply description and retry\n  }\n}","preventionTips":["Treat path, description, apiGroup as a required triple when calling api_creator.","Prompt LLM agents with explicit required-field lists for this tool.","Add form-level required validation on description before submission."],"tags":["mcp","missing-argument","validation"],"backgroundTag":"missing-required-parameter","analyzedSha":"3136500ef380842b0eb6c4daa87c3f8a47fcf9e0","analyzedAt":"2026-08-31T13:50:02.721Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}