Skip to content

refactor: consolidate MCP tool callback hierarchy and improve error handling#57

Merged
tzolov merged 3 commits intospring-ai-community:mainfrom
tzolov:tool-calling-error-handling
Sep 18, 2025
Merged

refactor: consolidate MCP tool callback hierarchy and improve error handling#57
tzolov merged 3 commits intospring-ai-community:mainfrom
tzolov:tool-calling-error-handling

Conversation

@tzolov
Copy link
Copy Markdown
Collaborator

@tzolov tzolov commented Sep 18, 2025

  • Introduce AbstractMcpToolMethodCallback as common base class to eliminate code duplication
  • Rename error handling methods for clarity:
    • createErrorResult -> createAsyncErrorResult/createSyncErrorResult
    • validateRequest -> validateSyncRequest
  • Improve error messages using findCauseUsingPlainJava(e) to extract and display root cause instead of wrapper exceptions

…andling

- Introduce AbstractMcpToolMethodCallback as common base class to eliminate code duplication
- Rename error handling methods for clarity:
  - createErrorResult -> createAsyncErrorResult/createSyncErrorResult
  - validateRequest -> validateSyncRequest
- Improve error messages using findCauseUsingPlainJava(e) to extract and display root cause instead of wrapper exceptions

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
@tzolov tzolov merged commit 235765d into spring-ai-community:main Sep 18, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant