{"record":{"id":"380ff360936876e5","repo":"alibaba/spring-ai-alibaba","slug":"invalidparameter","errorCode":"InvalidParameter","errorMessage":"Parameters input_params invalid, Get method not support body params.","messagePattern":"Parameters input_params invalid, Get method not support body params\\.","errorType":"validation","errorClass":"BizException","httpStatus":400,"severity":"error","filePath":"spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-core/src/main/java/com/alibaba/cloud/ai/studio/core/base/service/impl/PluginServiceImpl.java","lineNumber":285,"sourceCode":"\t@Override\n\tpublic String createTool(Tool tool) {\n\t\ttry {\n\t\t\tRequestContext context = RequestContextHolder.getRequestContext();\n\t\t\tPlugin plugin = getPlugin(tool.getPluginId());\n\n\t\t\t// check if tool name exists\n\t\t\tToolEntity toolEntity = getToolByName(context.getWorkspaceId(), plugin.getPluginId(), tool.getName());\n\t\t\tif (toolEntity != null) {\n\t\t\t\tthrow new BizException(ErrorCode.TOOL_NAME_EXISTS.toError());\n\t\t\t}\n\n\t\t\tTool.ToolConfig config = tool.getConfig();\n\t\t\tList<ApiParameter> inputParams = config.getInputParams();\n\t\t\tif (!CollectionUtils.isEmpty(inputParams)) {\n\t\t\t\tfor (ApiParameter apiParameter : inputParams) {\n\t\t\t\t\tString location = apiParameter.getLocation();\n\t\t\t\t\tif (\"Get\".equals(config.getRequestMethod()) && location.equals(\"Body\")) {\n\t\t\t\t\t\tthrow new BizException(\n\t\t\t\t\t\t\t\tErrorCode.INVALID_PARAMS.toError(\"input_params\", \"Get method not support body params\"));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// convert to swagger yaml\n\t\t\tString yaml = OpenApiUtils.buildOpenAPIYaml(plugin, tool);\n\n\t\t\tif (StringUtils.isBlank(yaml) || !CollectionUtils.isEmpty(OpenApiUtils.parseOpenAPIObject(yaml))) {\n\t\t\t\tthrow new BizException(ErrorCode.BUILD_TOOL_SCHEMA_ERROR.toError());\n\t\t\t}\n\n\t\t\tString toolId = IdGenerator.idStr();\n\t\t\tToolEntity entity = BeanCopierUtils.copy(tool, ToolEntity.class);\n\t\t\tentity.setToolId(toolId);\n\t\t\tentity.setPluginId(tool.getPluginId());\n\t\t\tentity.setWorkspaceId(context.getWorkspaceId());\n\t\t\tentity.setConfig(JsonUtils.toJson(tool.getConfig()));","sourceCodeStart":267,"sourceCodeEnd":303,"githubUrl":"https://github.com/alibaba/spring-ai-alibaba/blob/f82da0b50f35744c13968191be2b1cd2452ef550/spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-core/src/main/java/com/alibaba/cloud/ai/studio/core/base/service/impl/PluginServiceImpl.java#L267-L303","documentation":"Validation thrown by PluginServiceImpl.createTool when the tool's HTTP request method is GET but one of its input parameters has location 'Body'. GET requests cannot carry a request body, so the tool configuration is rejected with code InvalidParameter.","triggerScenarios":"createTool(tool) where tool.getConfig().getRequestMethod() equals \"Get\" and any inputParams entry has apiParameter.getLocation() == \"Body\".","commonSituations":"Designing a tool from an API spec that uses GET but defines requestBody (OpenAPI quirks); users selecting GET in the UI while leaving body parameters configured; migrated/imported tool definitions.","solutions":["Change the request method to POST/PUT/PATCH if a body is required","Convert body parameters into query parameters for GET requests","Remove Body-located parameters from GET tool configs before creation"],"exampleFix":"// before\ntool.getConfig().setRequestMethod(\"Get\");\ninputParams.add(param(\"q\", \"Body\"));\npluginService.createTool(tool); // throws\n// after\ntool.getConfig().setRequestMethod(\"Get\");\ninputParams.add(param(\"q\", \"Query\")); // move body params to query\npluginService.createTool(tool);","handlingStrategy":"validation","validationCode":"Tool.ToolConfig cfg = tool.getConfig();\nboolean bad = \"Get\".equalsIgnoreCase(cfg.getRequestMethod())\n    && cfg.getInputParams() != null\n    && cfg.getInputParams().stream()\n        .anyMatch(p -> \"Body\".equalsIgnoreCase(p.getLocation()));\nif (bad) throw new IllegalArgumentException(\"GET tools cannot have Body params\");","typeGuard":"boolean isGetWithBody(Tool.ToolConfig cfg) {\n    return \"Get\".equalsIgnoreCase(cfg.getRequestMethod())\n        && cfg.getInputParams() != null\n        && cfg.getInputParams().stream().anyMatch(p -> \"Body\".equalsIgnoreCase(p.getLocation()));\n}","tryCatchPattern":"try {\n    pluginService.createTool(tool);\n} catch (BizException e) {\n    throw new ResponseStatusException(HttpStatus.BAD_REQUEST,\n        \"GET method does not support body params\", e);\n}","preventionTips":["Validate method/param-location compatibility in the UI","When importing API specs, move GET requestBody params to query","Default new tools to POST when body params are needed","Sanitize requestMethod casing before validation"],"tags":["tool","validation","http","parameters"],"backgroundTag":"schema-validation-failed","analyzedSha":"f82da0b50f35744c13968191be2b1cd2452ef550","analyzedAt":"2026-09-09T15:32:42.421Z","contentChangedAt":"2026-09-09T15:32:42.421Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}