spring-ai icon indicating copy to clipboard operation
spring-ai copied to clipboard

Problems with DefaultTools overloading, and SyncMcpToolCallbackProvider cannot be injected automatically

Open Inhenry opened this issue 8 months ago • 2 comments
trafficstars

Env: Image

When I configure the MCP client side using the Auto configuration, only List < McpClients > can find the bean and inject it; but SyncMcpToolCallbackProvider shows that the bean class is not found, unlike a reference archive (although ToolCallBackProvider types of beans can be injected).

Image

Image

In addition, if I use mcpclient's listTools () directly, the overload of .defaultTools() will also choose the parameter Object, causing the tool to fail. The solution is that .defaultTools ()/.tools () must pass parameters of the form ToolCallback

Image

Inhenry avatar Mar 21 '25 12:03 Inhenry