adityamparikh commented on PR #273: URL: https://github.com/apache/solr-mcp/pull/273#issuecomment-7197931332
Closing in favour of group 7 of the `typed-mcp-contracts` change (#306), which fixes #213 the way Spring AI 2.1 documents rather than with an aspect. The [MCP annotations docs](https://docs.spring.io/spring-ai/reference/2.0-SNAPSHOT/api/mcp/mcp-annotations-server.html) say a declared checked exception from an `@McpTool` method is a hard failure by design, and that a tool which wants the model to see an error should convert it to a `RuntimeException` in the method body. The 2.1.0 source matches: `AbstractMcpToolMethodCallback.callMethod` wraps a checked cause in `UndeclaredThrowableException`, which `SyncMcpToolMethodCallback` rethrows, while a `RuntimeException` becomes the `isError` result. Group 7 therefore: - translates Solr failures inside each tool, through one shared helper; - drops the `throws SolrServerException, IOException` clauses; - keeps Solr's own reason in the error text with the `Error from server at <host>:` prefix removed. A conformance test will check every tool over the wire: an `isError` result, never a `-32603`, and no Solr URL in the text. The group 7 PR will close #213. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
