spring-projects / spring-projects/spring-ai
Ability to react to exceptions thrown by @McpTool methods
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 9.5k
- Forks
- 2.9k
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 6
Description
Expected Behavior
There is a way for me to react to @McpTool methods throwing exceptions, e.g. to log them.
Current Behavior
There is no way to react to exceptions, they are turned into an MCP error response (great!) and then discard, losing all stacktrace and cause information (not great!).
Context
I'm trying to diagnose errors in an MCP tool and not having the errors logged makes it quite painful.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the exception handling path for methods annotated with @McpTool and trace where exceptions become MCP error responses. Determine the project-supported way to expose or log the original exception, including its stack trace and cause, while preserving the existing error response behavior. Done means tool failures can be diagnosed without losing that information.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100