Bug description I found an issue when making MCP calls, where an error occurs when the requesting controller returns Flux<> in reactive mode
java.lang.IllegalStateException: Multiple tools with the same name (getDayOfWeek, getCurrentDate) found in ToolCallingChatOptions
at org.springframework.ai.model.tool.ToolCallingChatOptions.validateToolCallbacks(ToolCallingChatOptions.java:227) ~[spring-ai-core-1.0.0-M6.jar:1.0.0-M6]
Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:
Environment java: oracle openJDK17 Spring AI: 1.0.0-M6 LM Studio: 0.3.12 Model: Qwen2.5
Steps to reproduce
cd spring-mcp-test
mvn clean package
java -jar mcp-server/target/mcp-server.jar
java -jar mcp-client/target/mcp-client.jar
curl http://localhost:8080/ai/mcp?message=listfiles
Expected behavior Some information about files.
Minimal Complete Reproducible example Check out the project https://github.com/fxz26284407/spring-mcp-test
Comment From: Willam2004
I have the same problem. i try to debug for reason because open the mcp client have two instance.
and also use the Spring AI: 1.0.0-M6
Comment From: tzolov
Resolved by 3f7f2f1bffade3d6029dc6bca9631033533273d8 and 957150128b13c03e0381941b18eb56df8979ddf6 Feel free to re-open if the issue is still present.
Comment From: aliyun1024qjc
Issue Description
When using Spring AI 1.0.0-M6, I noticed a difference in behavior between SYNC and ASYNC modes regarding tool registration:
- With
type: ASYNC
: The application starts successfully even with duplicate tools - With
type: SYNC
: The application throwsMultiple tools with the same name
exception
This seems related to issue #2422, which was marked as resolved. However, the behavior difference between SYNC and ASYNC modes might need further investigation.
Environment
- Spring AI version: 1.0.0-M6
- Java version: JDK 17
- OS: Windows 10
Steps to Reproduce
- Configure a Spring AI application with duplicate tool registrations
- Try running with
type: SYNC
- Results in error - Try running with
type: ASYNC
- Works without error