{"record":{"id":"7ba8a237f5029910","repo":"alibaba/nacos","slug":"parameter-mismatch","errorCode":"PARAMETER_MISMATCH","errorMessage":"Parameter 'searchMode' must be \" + Constants.MCP_LIST_SEARCH_BLUR + \" or \" + Constants.MCP_LIST_SEARCH_ACCURATE","messagePattern":"Parameter 'searchMode' must be \" \\+ Constants\\.MCP_LIST_SEARCH_BLUR \\+ \" or \" \\+ Constants\\.MCP_LIST_SEARCH_ACCURATE","errorType":"validation","errorClass":"NacosApiException","httpStatus":400,"severity":"error","filePath":"ai-registry-adaptor/src/main/java/com/alibaba/nacos/airegistry/form/ListServerForm.java","lineNumber":104,"sourceCode":"     */\n    @Override\n    public void validate() throws NacosApiException {\n        if (offset < 0) {\n            throw new NacosApiException(HttpStatus.BAD_REQUEST.value(),\n                ErrorCode.PARAMETER_VALIDATE_ERROR,\n                \"Parameter 'offset' must >= 0\");\n        }\n        \n        if (limit > Constants.MAX_LIST_SIZE) {\n            throw new NacosApiException(HttpStatus.BAD_REQUEST.value(),\n                ErrorCode.PARAMETER_VALIDATE_ERROR,\n                \"Parameter 'limit' must <= 100\");\n        }\n        \n        if (StringUtils.isNotEmpty(searchMode)) {\n            if (!Constants.MCP_LIST_SEARCH_BLUR.equals(searchMode)\n                && !Constants.MCP_LIST_SEARCH_ACCURATE.equals(searchMode)) {\n                throw new NacosApiException(HttpStatus.BAD_REQUEST.value(),\n                    ErrorCode.PARAMETER_MISMATCH,\n                    \"Parameter 'searchMode' must be \" + Constants.MCP_LIST_SEARCH_BLUR + \" or \"\n                        + Constants.MCP_LIST_SEARCH_ACCURATE);\n            }\n        }\n        \n    }\n}\n","sourceCodeStart":86,"sourceCodeEnd":113,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/ai-registry-adaptor/src/main/java/com/alibaba/nacos/airegistry/form/ListServerForm.java#L86-L113","documentation":"ListServerForm constrains searchMode to two allowed values (Constants.MCP_LIST_SEARCH_BLUR and Constants.MCP_LIST_SEARCH_ACCURATE, i.e. \"blur\" and \"accurate\"). Any other non-empty value throws PARAMETER_MISMATCH (HTTP 400).","triggerScenarios":"Calling the list-servers endpoint with ?searchMode=fuzzy, ?searchMode=exact, or any value other than blur/accurate.","commonSituations":"Guessing the enum values; passing a localized or uppercased string (the comparison is case-sensitive); leftover param from a different API.","solutions":["Use exactly searchMode=blur or searchMode=accurate.","Omit searchMode entirely to use the server default rather than guessing.","Confirm the exact string values against Constants.MCP_LIST_SEARCH_BLUR/ACCURATE."],"exampleFix":"// before\nGET /servers?searchMode=fuzzy\n\n// after\nGET /servers?searchMode=blur","handlingStrategy":"validation","validationCode":"Set<String> allowed = Set.of(\"blur\", \"accurate\"); // MCP_LIST_SEARCH_BLUR/ACCURATE\nString mode = StringUtils.isBlank(searchMode) ? null : (allowed.contains(searchMode) ? searchMode : null);\nif (mode != null) uri.queryParam(\"searchMode\", mode);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Omit searchMode rather than guessing the enum value.","Match the exact lowercase strings blur/accurate.","Centralize allowed enum values in the client."],"tags":["pagination","validation","search","ard","ai"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}