davsclaus commented on code in PR #25490:
URL: https://github.com/apache/camel/pull/25490#discussion_r3775916263


##########
components/camel-ai/camel-mcp-server-api/src/main/java/org/apache/camel/component/mcp/server/McpServerBridge.java:
##########
@@ -305,19 +303,22 @@ private McpToolCallResult execute(AiToolSpec spec, 
Map<String, Object> arguments
         }
     }
 
+    private boolean matchesTag(String tag) {
+        return tag != null && PatternHelper.matchPatterns(tag, tagPatterns);

Review Comment:
   Good catch — added `PatternHelper.matchSimplePattern()` / 
`matchSimplePatterns()` that skip the regex fallback entirely. Tag matching now 
only supports exact match (case-insensitive), wildcard prefix (`foo*`), and `*` 
for match-all. This keeps things user-friendly and avoids surprising regex 
behavior like `a.b` matching `axb`.
   
   Also added unit tests for the new methods in `PatternHelperTest`, including 
a test that explicitly verifies the regex fallback does NOT apply.



##########
components/camel-ai/camel-mcp-server-api/src/main/java/org/apache/camel/component/mcp/server/McpServerConfiguration.java:
##########
@@ -35,8 +35,9 @@ public class McpServerConfiguration {
     private long sessionIdleTtl = McpServerConstants.DEFAULT_SESSION_IDLE_TTL;
 
     /**
-     * Comma-separated list of ai-tool tags to expose as MCP tools. Only tools 
registered under one of these tags are
-     * published; the untagged default pool is never exposed. When not set, no 
tools are published.
+     * Comma-separated list of ai-tool tag patterns to expose as MCP tools. 
Patterns support exact match, wildcard
+     * prefix ({@code foo*}), and {@code *} to match all tags. Only tools 
registered under a matching tag are published;
+     * the untagged default pool is never exposed. When not set, no tools are 
published.

Review Comment:
   Updated the Javadoc on `McpServerConfiguration.getTags()` and 
`HttpServerConfigurationProperties` to document that matching is 
case-insensitive. Since we dropped the regex fallback (see other comment), the 
docs now accurately describe: exact match (case-insensitive), wildcard prefix 
(`foo*`), and `*` to match all.



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