jiriOndrusek-agent commented on code in PR #28513:
URL: https://github.com/apache/camel/pull/28513#discussion_r4379235256


##########
components/camel-ai/camel-mcp-server-api/src/main/java/org/apache/camel/component/mcp/server/McpServerBridge.java:
##########
@@ -236,8 +237,14 @@ private void publish(AiToolSpec spec) {
                         spec.getName());
                 return;
             }
+            try {
+                engine.toolAdded(createTool(spec));
+            } catch (McpServerRefusedException e) {
+                LOG.error("Refusing to expose MCP tool '{}': {}", 
spec.getName(), e.getMessage(), e.getCause());
+                return;

Review Comment:
   Applied as suggested in `79212f301afa` (same for the resource at `:298`). 
The ERROR now carries the refusal's stack trace, whose top frame is the 
refusing engine. A cause given to the two-arg constructor still shows as 
`Caused by`.
   
   _Generated with [Claude Code](https://claude.com/claude-code) on behalf of 
@JiriOndrusek_



##########
components/camel-ai/camel-mcp-server-api/src/main/java/org/apache/camel/component/mcp/server/McpServerBridge.java:
##########
@@ -284,8 +291,13 @@ private void publishResource(AiResourceSpec spec) {
                 }
                 return;
             }
+            try {
+                engine.resourceAdded(createResource(spec));
+            } catch (McpServerRefusedException e) {
+                LOG.error("Refusing to expose MCP resource '{}': {}", 
spec.getUri(), e.getMessage(), e.getCause());
+                return;

Review Comment:
   Applied as suggested in `79212f301afa`, as for the tool.
   
   _Generated with [Claude Code](https://claude.com/claude-code) on behalf of 
@JiriOndrusek_



-- 
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]

Reply via email to