gnodet-bot commented on code in PR #27511:
URL: https://github.com/apache/camel/pull/27511#discussion_r4209405827
##########
dsl/camel-jbang/camel-jbang-mcp/src/main/java/org/apache/camel/dsl/jbang/core/commands/mcp/KameletTools.java:
##########
@@ -48,8 +48,9 @@ public class KameletTools {
public KameletListResult camel_catalog_kamelets(
@ToolArg(description = "Filter kamelets by name or description
(case-insensitive substring match)") String filter,
@ToolArg(description = "Filter by type: source, sink, or action")
String type,
Review Comment:
⚠️ **Missing `required = false`:** `type` is null-guarded (no type filter
when null).
```suggestion
@ToolArg(description = "Filter by type: source, sink, or action",
required = false) String type,
```
##########
dsl/camel-jbang/camel-jbang-mcp/src/main/java/org/apache/camel/dsl/jbang/core/commands/mcp/KameletTools.java:
##########
@@ -48,8 +48,9 @@ public class KameletTools {
public KameletListResult camel_catalog_kamelets(
@ToolArg(description = "Filter kamelets by name or description
(case-insensitive substring match)") String filter,
Review Comment:
⚠️ **Missing `required = false`:** `filter` is null-guarded (the method
handles `null` as no-filter), like the other params updated in this PR.
```suggestion
@ToolArg(description = "Filter kamelets by name or description
(case-insensitive substring match)",
required = false) String filter,
```
##########
dsl/camel-jbang/camel-jbang-mcp/src/main/java/org/apache/camel/dsl/jbang/core/commands/mcp/RuntimeTools.java:
##########
@@ -541,15 +543,19 @@ public JsonObject camel_runtime_memory_leak(
@ToolArg(description = NAME_OR_PID_DESC, required = false) String
nameOrPid,
@ToolArg(description = "Command: start, stop, status, or query")
String command,
@ToolArg(description = "Recording duration in seconds (only for
start command, default 60, use 0 for manual stop)") String duration,
Review Comment:
⚠️ **Missing `required = false`:** Description says "default 60" and `0`
means manual stop — `duration` is optional but wasn't updated in this PR.
```suggestion
@ToolArg(description = "Recording duration in seconds (only for
start command, default 60, use 0 for manual stop)",
required = false) String duration,
```
##########
dsl/camel-jbang/camel-jbang-mcp/src/main/java/org/apache/camel/dsl/jbang/core/commands/mcp/RouteDiagramTools.java:
##########
@@ -50,18 +50,22 @@ public class RouteDiagramTools {
public RouteDiagramResult camel_render_route_diagram(
@ToolArg(description = "Absolute or relative path to the Camel
route source file (YAML, XML, Java, ...)") String sourceFile,
@ToolArg(description = "Optional output file path. For image
themes a PNG is written; for text themes a .txt "
- + "file is written. If not specified, a
temporary file is created.") String outputFile,
+ + "file is written. If not specified, a
temporary file is created.",
+ required = false) String outputFile,
@ToolArg(description = "Color theme: 'dark' (default), 'light',
'transparent', 'ascii' (plain ASCII art), "
+ "'unicode' (box-drawing characters), or a
custom spec like "
+ "'bg=#1e1e1e:from=#2e7d32:to=#1565c0'. "
- + "Use 'ascii' or 'unicode' to get a text
diagram that can be read directly.") String theme,
+ + "Use 'ascii' or 'unicode' to get a text
diagram that can be read directly.",
+ required = false) String theme,
@ToolArg(description = "Optional filter to limit the diagram to
routes whose route id or source filename "
- + "matches the given pattern (supports
wildcards)") String filter,
+ + "matches the given pattern (supports
wildcards)",
+ required = false) String filter,
@ToolArg(description = "Image width in pixels; 0 (or unset) = auto
(only used for image themes)") Integer width,
Review Comment:
⚠️ **Missing `required = false`:** Description says "0 (or unset) = auto" —
`width` is optional but wasn't updated.
```suggestion
@ToolArg(description = "Image width in pixels; 0 (or unset) =
auto (only used for image themes)",
required = false) Integer width,
```
##########
dsl/camel-jbang/camel-jbang-mcp/src/main/java/org/apache/camel/dsl/jbang/core/commands/mcp/RouteDiagramTools.java:
##########
@@ -50,18 +50,22 @@ public class RouteDiagramTools {
public RouteDiagramResult camel_render_route_diagram(
@ToolArg(description = "Absolute or relative path to the Camel
route source file (YAML, XML, Java, ...)") String sourceFile,
@ToolArg(description = "Optional output file path. For image
themes a PNG is written; for text themes a .txt "
- + "file is written. If not specified, a
temporary file is created.") String outputFile,
+ + "file is written. If not specified, a
temporary file is created.",
+ required = false) String outputFile,
@ToolArg(description = "Color theme: 'dark' (default), 'light',
'transparent', 'ascii' (plain ASCII art), "
+ "'unicode' (box-drawing characters), or a
custom spec like "
+ "'bg=#1e1e1e:from=#2e7d32:to=#1565c0'. "
- + "Use 'ascii' or 'unicode' to get a text
diagram that can be read directly.") String theme,
+ + "Use 'ascii' or 'unicode' to get a text
diagram that can be read directly.",
+ required = false) String theme,
@ToolArg(description = "Optional filter to limit the diagram to
routes whose route id or source filename "
- + "matches the given pattern (supports
wildcards)") String filter,
+ + "matches the given pattern (supports
wildcards)",
+ required = false) String filter,
@ToolArg(description = "Image width in pixels; 0 (or unset) = auto
(only used for image themes)") Integer width,
- @ToolArg(description = "Font size in logical pixels for node text
(default 12)") Integer fontSize,
- @ToolArg(description = "Node box width in logical pixels (default
180)") Integer boxWidth,
+ @ToolArg(description = "Font size in logical pixels for node text
(default 12)", required = false) Integer fontSize,
+ @ToolArg(description = "Node box width in logical pixels (default
180)", required = false) Integer boxWidth,
@ToolArg(description = "What text to display in diagram nodes:
'code' (default), 'description' (prefer "
- + "description over code if available), or
'both' (show description and code)") String nodeLabel,
+ + "description over code if available), or
'both' (show description and code)",
+ required = false) String nodeLabel,
@ToolArg(description = "Whether to ignore route loading and
compilation errors (use with care)") Boolean ignoreLoadingError) {
Review Comment:
⚠️ **Missing `required = false`:** `ignoreLoadingError` is a nullable
`Boolean` and the code treats `null` as `false` — it's optional by design but
wasn't updated.
```suggestion
@ToolArg(description = "Whether to ignore route loading and
compilation errors (use with care)",
required = false) Boolean ignoreLoadingError) {
```
##########
dsl/camel-jbang/camel-jbang-mcp/src/main/java/org/apache/camel/dsl/jbang/core/commands/mcp/RuntimeTools.java:
##########
@@ -541,15 +543,19 @@ public JsonObject camel_runtime_memory_leak(
@ToolArg(description = NAME_OR_PID_DESC, required = false) String
nameOrPid,
@ToolArg(description = "Command: start, stop, status, or query")
String command,
@ToolArg(description = "Recording duration in seconds (only for
start command, default 60, use 0 for manual stop)") String duration,
- @ToolArg(description = "Recording mode: dual (default, two
recordings at Xs and 2Xs with trend comparison) or single (one recording)")
String mode,
- @ToolArg(description = "Include allocation stack traces in results
(default false, set true for detailed analysis)") String stacktrace,
+ @ToolArg(description = "Recording mode: dual (default, two
recordings at Xs and 2Xs with trend comparison) or single (one recording)",
+ required = false) String mode,
+ @ToolArg(description = "Include allocation stack traces in results
(default false, set true for detailed analysis)",
+ required = false) String stacktrace,
@ToolArg(description = "Minimum total size in bytes to include a
sample (e.g. 1024 for 1KB). Filters out small allocations to reduce noise.
Default 1024 (1KB) in dual mode") String minSize) {
Review Comment:
⚠️ **Missing `required = false`:** Description says "Default 1024 (1KB) in
dual mode" — `minSize` is optional but wasn't updated.
```suggestion
@ToolArg(description = "Minimum total size in bytes to include a
sample (e.g. 1024 for 1KB). Filters out small allocations to reduce noise.
Default 1024 (1KB) in dual mode",
required = false) String minSize) {
```
--
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]