This is an automated email from the ASF dual-hosted git repository.
tdiesler pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git
The following commit(s) were added to refs/heads/main by this push:
new eba15dda98b CSB-13053: camel-mcp-server Spring Boot engine drops the
returnDirect tool annotation
eba15dda98b is described below
commit eba15dda98baead7c3ccdfabf88a9eb4c2cf8822
Author: Thomas <[email protected]>
AuthorDate: Mon Nov 2 18:36:44 2026 +0100
CSB-13053: camel-mcp-server Spring Boot engine drops the returnDirect tool
annotation
- SpringAiMcpServerEngine mapped
title/readOnlyHint/destructiveHint/idempotentHint/openWorldHint, never
returnDirect
- Vert.x engine already maps returnDirect correctly; Spring Boot engine was
missing it
- Clients reading tools/list saw returnDirect as null instead of the
configured value
- Extended SpringBootMcpServerTest to cover returnDirect
- mvn verify -Dtest=SpringBootMcpServerTest
Co-Authored-By: Claude Sonnet 5 <[email protected]>
---
.../apache/camel/springboot/mcp/server/SpringAiMcpServerEngine.java | 4 ++++
.../apache/camel/springboot/mcp/server/SpringBootMcpServerTest.java | 4 +++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git
a/components-starter/camel-mcp-server-starter/src/main/java/org/apache/camel/springboot/mcp/server/SpringAiMcpServerEngine.java
b/components-starter/camel-mcp-server-starter/src/main/java/org/apache/camel/springboot/mcp/server/SpringAiMcpServerEngine.java
index 1f8939af346..4638d003cae 100644
---
a/components-starter/camel-mcp-server-starter/src/main/java/org/apache/camel/springboot/mcp/server/SpringAiMcpServerEngine.java
+++
b/components-starter/camel-mcp-server-starter/src/main/java/org/apache/camel/springboot/mcp/server/SpringAiMcpServerEngine.java
@@ -138,6 +138,10 @@ public class SpringAiMcpServerEngine extends
ServiceSupport implements McpServer
hintBuilder.openWorldHint(annotations.openWorldHint());
hasHints = true;
}
+ if (annotations.returnDirect() != null) {
+ hintBuilder.returnDirect(annotations.returnDirect());
+ hasHints = true;
+ }
if (hasHints) {
builder.annotations(hintBuilder.build());
}
diff --git
a/components-starter/camel-mcp-server-starter/src/test/java/org/apache/camel/springboot/mcp/server/SpringBootMcpServerTest.java
b/components-starter/camel-mcp-server-starter/src/test/java/org/apache/camel/springboot/mcp/server/SpringBootMcpServerTest.java
index 3f075e8414c..ae5198fb3bc 100644
---
a/components-starter/camel-mcp-server-starter/src/test/java/org/apache/camel/springboot/mcp/server/SpringBootMcpServerTest.java
+++
b/components-starter/camel-mcp-server-starter/src/test/java/org/apache/camel/springboot/mcp/server/SpringBootMcpServerTest.java
@@ -119,7 +119,8 @@ public class SpringBootMcpServerTest {
from("ai-tool:annotated_tool?tags=conformance&description=Tool with annotation
hints"
+ "&title=Annotated tool"
+ "&readOnlyHint=true"
- + "&idempotentHint=true")
+ + "&idempotentHint=true"
+ + "&returnDirect=true")
.setBody(constant("annotated"));
}
};
@@ -166,6 +167,7 @@ public class SpringBootMcpServerTest {
assertThat(tool.annotations()).isNotNull();
assertThat(tool.annotations().readOnlyHint()).isTrue();
assertThat(tool.annotations().idempotentHint()).isTrue();
+ assertThat(tool.annotations().returnDirect()).isTrue();
}
@Test