apache/incubator-seata · warning · IllegalArgumentException
User confirmation string is required.
Error message
User confirmation string is required.
What it means
Thrown by the Seata MCP ModifyConfirmTools when the confirmAndGetKey tool is invoked with a null, empty, or whitespace-only userInputStr. This tool implements a human-in-the-loop gate: before any update/delete of a transaction or lock, the end user (not the LLM) must type a confirmation string, and the server issues a one-time modify key only after that.
Source
Thrown at console/src/main/java/org/apache/seata/mcp/tools/ModifyConfirmTools.java:49
private static final Logger LOGGER = LoggerFactory.getLogger(ModifyConfirmTools.class);
private final ModifyConfirmService modifyConfirmService;
public ModifyConfirmTools(ModifyConfirmService modifyConfirmService) {
this.modifyConfirmService = modifyConfirmService;
}
@McpTool(
description = "Before modifying (update or delete) a transaction or lock, the user MUST manually confirm."
+ "You are NOT allowed to fabricate or auto-confirm on behalf of the user.")
public Map<String, String> confirmAndGetKey(
@McpToolParam(
description =
"The confirmation string provided by the USER (not generated by the LLM).The content must repeat the modification action clearly.")
String userInputStr) {
if (StringUtils.isBlank(userInputStr)) {
throw new IllegalArgumentException("User confirmation string is required.");
}
if (!userInputStr.contains("确认") && !userInputStr.contains("confirm")) {
throw new IllegalArgumentException(
"Confirmation string must explicitly contain '确认' or 'confirm' and repeat the modification content. This must come from the user.");
}
Map<String, String> keyMap = modifyConfirmService.confirmAndGetKey();
LOGGER.info("the user obtains a modify key:{}", keyMap.get("modify_key"));
return keyMap;
}
}
View on GitHub (pinned to e01f97c6db)
Solutions
- Make the LLM/client always ask the real user for a typed confirmation before invoking the tool, and pass that exact text as userInputStr.
- If building an MCP client, mark userInputStr as required so the schema rejects the call before it reaches the server.
- If the workflow is fully automated, remove the modify-confirm gate from your deployment instead of bypassing it with blank input.
Example fix
// before
Map<String,String> key = tools.confirmAndGetKey(null);
// after: collect the user's typed confirmation first
Map<String,String> key = tools.confirmAndGetKey("confirm: delete xid 192.168.1.1:8091:123456"); Defensive patterns
Strategy: validation
Validate before calling
if (userInputStr == null || userInputStr.isBlank()) {
// ask the user; do NOT call the tool yet
return "Confirmation required: please type your confirmation.";
} Type guard
private boolean isConfirmable(String s) {
return s != null && !s.isBlank();
} Try / catch
catch (IllegalArgumentException e) {
if (e.getMessage().contains("required")) { promptUserForConfirmation(); }
else { throw e; }
} Prevention
- Treat confirmAndGetKey input as user-originated only; never let the LLM fill it
- Mark the MCP param required in client schemas
- Log which user issued each modify key for audit
When it happens
Trigger: An MCP client or LLM calls the confirmAndGet_key tool without arguments, passes an empty string, or a calling agent omits the userInputStr parameter entirely.
Common situations: LLM agent tries to skip the confirmation step and call the modify tool directly; MCP client deserializes the argument to null; automated scripts call the tool non-interactively with no user present.
Related errors
- Confirmation string must explicitly contain '确认' or 'confirm
- endTime must not be earlier than startTime
- Two or more start states, ${target} and ${definitions.StartS
- URL must not be null or blank
- ip and port string cannot be empty!
AI-assisted analysis of apache/incubator-seata@e01f97c6db (2026-08-14).
Data as JSON: /api/errors/ef58ff0d6004c258.
Report an issue: GitHub.