{"record":{"id":"4997c47a19e40c3b","repo":"alibaba/nacos","slug":"parameter-missing-4997c4","errorCode":"PARAMETER_MISSING","errorMessage":"Required parameter 'serverSpecification' type McpServerBasicInfo is not present","messagePattern":"Required parameter 'serverSpecification' type McpServerBasicInfo is not present","errorType":"exception","errorClass":"NacosApiException","httpStatus":400,"severity":"warning","filePath":"ai/src/main/java/com/alibaba/nacos/ai/remote/handler/ReleaseMcpServerRequestHandler.java","lineNumber":96,"sourceCode":"    @ExtractorManager.Extractor(rpcExtractor = McpServerRequestParamExtractor.class)\n    @Secured(action = ActionTypes.WRITE, signType = SignType.AI)\n    public ReleaseMcpServerResponse handle(ReleaseMcpServerRequest request, RequestMeta meta)\n        throws NacosException {\n        McpRequestUtil.fillNamespaceId(request);\n        try {\n            checkParameters(request);\n            return doHandler(request, meta);\n        } catch (NacosException e) {\n            ReleaseMcpServerResponse response = new ReleaseMcpServerResponse();\n            response.setErrorInfo(e.getErrCode(), e.getErrMsg());\n            return response;\n        }\n    }\n    \n    private void checkParameters(ReleaseMcpServerRequest request) throws NacosException {\n        McpServerBasicInfo serverSpecification = request.getServerSpecification();\n        if (null == serverSpecification) {\n            throw new NacosApiException(NacosException.INVALID_PARAM, ErrorCode.PARAMETER_MISSING,\n                \"Required parameter 'serverSpecification' type McpServerBasicInfo is not present\");\n        }\n        String mcpName = serverSpecification.getName();\n        if (StringUtils.isEmpty(mcpName)) {\n            throw new NacosApiException(NacosException.INVALID_PARAM, ErrorCode.PARAMETER_MISSING,\n                \"Required parameter 'serverSpecification.name' type String is not present\");\n        }\n        if (null == serverSpecification.getVersionDetail() || StringUtils.isBlank(\n            serverSpecification.getVersionDetail().getVersion())) {\n            throw new NacosApiException(NacosException.INVALID_PARAM, ErrorCode.PARAMETER_MISSING,\n                \"Required parameter `serverSpecification.versionDetail.version` not present\");\n        }\n    }\n    \n    private ReleaseMcpServerResponse doHandler(ReleaseMcpServerRequest request, RequestMeta meta)\n        throws NacosException {\n        String namespaceId = request.getNamespaceId();\n        McpServerBasicInfo serverSpecification = request.getServerSpecification();","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/ai/src/main/java/com/alibaba/nacos/ai/remote/handler/ReleaseMcpServerRequestHandler.java#L78-L114","documentation":"Thrown by ReleaseMcpServerRequestHandler.checkParameters() when request.getServerSpecification() is null. The serverSpecification (McpServerBasicInfo) is the root required payload for releasing/publishing an MCP server. Mapped to PARAMETER_MISSING with an INVALID_PARAM top-level code; caught by handle() and placed into the response error info.","triggerScenarios":"A gRPC ReleaseMcpServerRequest with no serverSpecification object at all. The check is the very first validation, before name and version checks.","commonSituations":"Client constructs ReleaseMcpServerRequest but only sets tool/resource specs, forgetting the server spec; a serialization issue where the field is dropped on the wire; a test that sends an empty request.","solutions":["Populate request.setServerSpecification(mcpServerBasicInfo) with a fully-formed McpServerBasicInfo.","Ensure the gRPC message is serialized with the serverSpecification field present (check field numbering/protobuf compatibility).","Validate the request payload non-null client-side before sending."],"exampleFix":"// before\nReleaseMcpServerRequest req = new ReleaseMcpServerRequest();\n// serverSpecification never set\n\n// after\nMcpServerBasicInfo spec = new McpServerBasicInfo();\nspec.setName(\"my-mcp-server\");\nspec.setVersionDetail(buildVersion(\"1.0.0\"));\nreq.setServerSpecification(spec);","handlingStrategy":"validation","validationCode":"if (request.getServerSpecification() == null) {\n    throw new IllegalArgumentException(\"serverSpecification (McpServerBasicInfo) is required\");\n}","typeGuard":"static boolean hasServerSpec(ReleaseMcpServerRequest r) {\n    return r != null && r.getServerSpecification() instanceof McpServerBasicInfo;\n}","tryCatchPattern":"ReleaseMcpServerResponse resp = handler.handle(request, meta);\nif (resp.getErrCode() != 0 && resp.getErrMsg().contains(\"serverSpecification\")) {\n    // rebuild request with a non-null McpServerBasicInfo and retry\n}","preventionTips":["Build McpServerBasicInfo first and assert non-null before constructing the request.","Add a protobuf/serialization smoke test to ensure serverSpecification survives the wire.","Centralize release-request construction in one builder method with mandatory fields."],"tags":["ai","mcp-server","grpc","validation","parameter","release"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}