alibaba/spring-ai-alibaba · error · BizException
TOOL_PARAMS_MISSING
TOOL_PARAMS_MISSING
Error message
TOOL_PARAMS_MISSING: execution_request
What it means
TOOL_PARAMS_MISSING with parameter 'execution_request' is thrown by ToolExecutionServiceImpl.executeTool when the ToolExecutionRequest argument itself is null. The method cannot proceed without any request object, so it fails fast with this validation error.
Source
Thrown at spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-core/src/main/java/com/alibaba/cloud/ai/studio/core/base/service/impl/ToolExecutionServiceImpl.java:74
private final PluginService pluginService;
/** Manager for handling HTTP client operations */
private final HttpClientManager httpClientManager;
public ToolExecutionServiceImpl(PluginService pluginService, HttpClientManager httpClientManager) {
this.pluginService = pluginService;
this.httpClientManager = httpClientManager;
}
/**
* Executes a tool based on the provided request. Validates the request and retrieves
* necessary tool and plugin information.
* @param request The tool execution request containing arguments and tool information
* @return The result of the tool execution
*/
public ToolExecutionResult executeTool(ToolExecutionRequest request) {
if (request == null) {
throw new BizException(ErrorCode.TOOL_PARAMS_MISSING.toError("execution_request"));
}
Map<String, Object> inputParams = request.getArguments();
if (inputParams == null) {
throw new BizException(ErrorCode.TOOL_PARAMS_MISSING.toError("arguments"));
}
if (request.getTool() == null) {
if (Objects.isNull(request.getToolId())) {
throw new BizException(ErrorCode.TOOL_PARAMS_MISSING.toError("tool_id"));
}
Tool tool = pluginService.getTool(request.getToolId());
request.setTool(tool);
if (tool.getPlugin() == null) {
if (Objects.isNull(request.getPluginId())) {
throw new BizException(ErrorCode.TOOL_PARAMS_MISSING.toError("plugin_id"));View on GitHub (pinned to f82da0b50f)
Solutions
- Ensure a non-null ToolExecutionRequest is constructed before calling executeTool.
- Check deserialization: send a valid JSON body with required fields so the request binds to an object.
- In controllers, use @Valid/@NotNull on the request parameter to reject null bodies earlier.
- Null-check or use Optional around the code path that produces the request before invoking executeTool.
Example fix
// before
ToolExecutionResult result = toolExecutionService.executeTool(buildRequest(input));
// after
ToolExecutionRequest req = buildRequest(input);
if (req == null) {
throw new IllegalArgumentException("tool execution request is required");
}
ToolExecutionResult result = toolExecutionService.executeTool(req); Defensive patterns
Strategy: type-guard
Validate before calling
if (request == null) {
throw new IllegalArgumentException("execution_request is required");
}
toolExecutionService.executeTool(request); Type guard
ToolExecutionRequest requireRequest(ToolExecutionRequest r) {
return Objects.requireNonNull(r, "execution_request must not be null");
} Try / catch
try {
toolExecutionService.executeTool(request);
} catch (BizException e) {
if (e.getMessage().contains("execution_request")) {
// log and return 400: request body missing
}
throw e;
} Prevention
- Use @NotNull/@Valid on controller request bodies so nulls are rejected at the boundary.
- Never let builders return null — throw or return Optional instead.
- Add a fail-fast null check at the caller of executeTool.
- Cover the null-request path in unit tests.
When it happens
Trigger: Calling executeTool(null), e.g. when an upstream builder returned null on failure, a controller passed an unbound request body, or deserialization of the request payload failed and produced null.
Common situations: REST controller receiving an empty body mapped to a null request; a workflow node constructing the request conditionally and skipping creation; unit tests invoking the service with no request.
Related errors
- MISSING_PARAMS
- invalid agent dsl: data is null
- Dataset ID cannot be null
- ttlUnit cannot be null
- key cannot be null
AI-assisted analysis of alibaba/spring-ai-alibaba@f82da0b50f (2026-09-09).
Data as JSON: /api/errors/59f6fec7736ee4b6.
Report an issue: GitHub.