-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Labels
MCPduplicateThis issue or pull request already existsThis issue or pull request already existsstatus: waiting-for-feedbacktool/function calling
Milestone
Description
Bug description
Integrating and calling an MCP Tool with an existing Spring AI application that uses a ToolContext will result in an UnsupportedOperationException.
Environment
Spring AI 1.0.0-M6
Steps to reproduce
- Integrate https://github.com/modelcontextprotocol/servers/tree/main/src/everything into a Spring AI application using https://docs.spring.io/spring-ai/reference/api/mcp/mcp-client-boot-starter-docs.html
- Set the ToolContext in your Spring AI application
- Call one of the tools provided by the everything MCP server, e.g. printEnv
- Observe "UnsupportedOperationException: Tool context is not supported!" for SyncMcpToolCallback
Exception is raised here:
spring-ai/spring-ai-core/src/main/java/org/springframework/ai/tool/ToolCallback.java
Line 57 in 2394ac8
| throw new UnsupportedOperationException("Tool context is not supported!"); |
Expected behavior
The MCP printEnv tool is called, ignoring the ToolContext (assuming this concept is not supported in MCP).
Metadata
Metadata
Assignees
Labels
MCPduplicateThis issue or pull request already existsThis issue or pull request already existsstatus: waiting-for-feedbacktool/function calling