alibaba/spring-ai-alibaba · error · BizException
MISSING_PARAMS
MISSING_PARAMS
Error message
serverName
What it means
BizException(MISSING_PARAMS) thrown by McpServerController.createMcpServer when the McpServerDetail body's `name` is blank. An MCP server registration requires a server name before mcpServerService.createMcp generates a server code.
Source
Thrown at spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/builder/controller/McpServerController.java:72
@RequestMapping("/console/v1/mcp-servers")
public class McpServerController {
private final McpServerService mcpServerService;
public McpServerController(McpServerService mcpServerService) {
this.mcpServerService = mcpServerService;
}
/**
* Creates a new MCP server with the provided configuration.
* @param detail Detailed configuration of the MCP server
* @return Result containing the server code of the newly created MCP server
*/
@PostMapping()
public Result<String> createMcpServer(@RequestBody McpServerDetail detail) {
RequestContext context = RequestContextHolder.getRequestContext();
if (StringUtils.isBlank(detail.getName())) {
throw new BizException(ErrorCode.MISSING_PARAMS.toError("serverName"));
}
if (StringUtils.isBlank(detail.getDeployConfig())) {
throw new BizException(ErrorCode.MISSING_PARAMS.toError("deployConfig"));
}
String serverCode = mcpServerService.createMcp(detail);
return Result.success(context.getRequestId(), serverCode);
}
/**
* Updates an existing MCP server with new configuration.
* @param detail Updated configuration for the MCP server
* @return Result indicating the success of the update operation
*/
@PutMapping()
public Result<String> updateMcpServer(@RequestBody McpServerDetail detail) {
RequestContext context = RequestContextHolder.getRequestContext();
if (StringUtils.isBlank(detail.getName())) {
throw new BizException(ErrorCode.MISSING_PARAMS.toError("serverName"));View on GitHub (pinned to f82da0b50f)
Solutions
- Set a non-blank `name` field in the McpServerDetail request body.
- Trim and validate the name client-side before POSTing.
- Check the JSON key is `name`, matching McpServerDetail.getName().
Example fix
// before
{"deployConfig": "{...}"}
// after
{"name": "my-mcp-server", "deployConfig": "{...}"} Defensive patterns
Strategy: validation
Validate before calling
if (detail == null || detail.getName() == null || detail.getName().isBlank()) {
throw new IllegalArgumentException("name is required to create an MCP server");
}
await client.createMcpServer(detail); Type guard
boolean hasServerName(McpServerDetail d) {
return d != null && d.getName() != null && !d.getName().isBlank();
} Try / catch
try {
Result<String> r = client.createMcpServer(detail);
} catch (BizException e) {
if ("MISSING_PARAMS".equals(e.getCode())) {
log.error("MCP server creation rejected, missing: {}", e.getMessage());
}
} Prevention
- Make the server-name field mandatory in creation forms.
- Trim names and reject blank strings before submission.
- Ensure the client model serializes the property as `name`.
When it happens
Trigger: POST to the MCP server endpoint with a body whose `name` property is missing, null, empty, or whitespace-only.
Common situations: Form submitted without the server name field; payload built from a config object where the name key is `serverName` locally but `name` on the wire; leading/trailing whitespace name trimmed to blank.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
AI-assisted analysis of alibaba/spring-ai-alibaba@f82da0b50f (2026-09-09).
Data as JSON: /api/errors/593c15cf04d9bba6.
Report an issue: GitHub.