gnodet commented on code in PR #24337:
URL: https://github.com/apache/camel/pull/24337#discussion_r3510845053
##########
dsl/camel-jbang/camel-jbang-mcp/src/main/java/org/apache/camel/dsl/jbang/core/commands/mcp/RuntimeTools.java:
##########
@@ -292,11 +311,10 @@ public JsonObject camel_runtime_route_topology(
@ToolArg(description = NAME_OR_PID_DESC) String nameOrPid,
@ToolArg(description = "Include live metrics (message counts,
throughput) on nodes and edges") Boolean metric,
@ToolArg(description = "Include external systems (databases,
messaging brokers, etc.) as nodes") Boolean external) {
- RuntimeService.ProcessInfo p =
runtimeService.findSingleProcess(nameOrPid);
- return runtimeService.executeAction(p.pid(), "route-topology", root ->
{
- root.put("metric", metric != null && metric ? "true" : "false");
- root.put("external", external != null && external ? "true" :
"false");
- });
+ Map<String, String> args = new HashMap<>();
+ args.put("metric", metric == null || metric ? "true" : "false");
Review Comment:
_Claude Code on behalf of Guillaume Nodet_
Yes, this is intentional — it aligns the MCP defaults with the ToolRegistry
defaults. ToolRegistry's `get_route_topology` defaults both `metric` and
`external` to `"true"` (line 248-249):
```java
root.put("metric", args.getOrDefault("metric", "true"));
root.put("external", args.getOrDefault("external", "true"));
```
The old MCP code had the same defaults (it always passed `true` for both),
but after the delegation refactor, the null-to-false conversion was silently
flipping the default. Since the MCP client controls these via explicit Boolean
parameters, the only time null is passed is when the LLM omits the argument —
and showing metrics/externals by default matches the prior behavior and is the
more useful default for diagnostics.
--
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]