Skip to content

Conversation

Kehrlann
Copy link
Contributor

Sync and Async McpToolCallback can now handle exceptions where cause == null instead of throwing a NPE.

This is the case when we do OAuth2 flows with Spring Security in MCP tools, because Spring Security relies on exceptions as signals to trigger "fetch an access_token" behavior.

@Kehrlann Kehrlann force-pushed the dgarnier/fix-tool-call-handling branch from 196e8ac to 86b7c4e Compare June 16, 2025 15:11
@Kehrlann Kehrlann marked this pull request as draft June 16, 2025 15:14
- Sync and Async McpToolCallback can now handle exceptions where cause == null instead of throwing a NPE. Signed-off-by: Daniel Garnier-Moiroux <git@garnier.wf>
@Kehrlann Kehrlann force-pushed the dgarnier/fix-tool-call-handling branch from 86b7c4e to adae8dc Compare June 16, 2025 15:44
@Kehrlann Kehrlann marked this pull request as ready for review June 16, 2025 15:50
@tzolov tzolov self-assigned this Jun 17, 2025
@tzolov tzolov added this to the 1.1.x milestone Jun 17, 2025
@tzolov tzolov added tool/function calling MCP bug Something isn't working labels Jun 17, 2025
tzolov pushed a commit that referenced this pull request Jun 17, 2025
- Sync and Async McpToolCallback can now handle exceptions where cause == null instead of throwing a NPE. Signed-off-by: Daniel Garnier-Moiroux <git@garnier.wf>
@tzolov
Copy link
Contributor

tzolov commented Jun 17, 2025

Thanks @Kehrlann
Rebased and merged at d6924b6

@tzolov tzolov closed this Jun 17, 2025
tzolov pushed a commit that referenced this pull request Jun 17, 2025
- Sync and Async McpToolCallback can now handle exceptions where cause == null instead of throwing a NPE. Signed-off-by: Daniel Garnier-Moiroux <git@garnier.wf>
scionaltera pushed a commit to scionaltera/spring-ai that referenced this pull request Sep 3, 2025
- Sync and Async McpToolCallback can now handle exceptions where cause == null instead of throwing a NPE. Signed-off-by: Daniel Garnier-Moiroux <git@garnier.wf>
@Kehrlann Kehrlann deleted the dgarnier/fix-tool-call-handling branch September 15, 2025 19:32
chedim pushed a commit to couchbaselabs/spring-ai that referenced this pull request Sep 19, 2025
- Sync and Async McpToolCallback can now handle exceptions where cause == null instead of throwing a NPE. Signed-off-by: Daniel Garnier-Moiroux <git@garnier.wf>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working MCP tool/function calling
2 participants