davsclaus commented on code in PR #25037:
URL: https://github.com/apache/camel/pull/25037#discussion_r3635892340
##########
components/camel-ai/camel-langchain4j-agent-api/src/main/java/org/apache/camel/component/langchain4j/agent/api/AbstractAgent.java:
##########
@@ -61,6 +64,15 @@ protected AgentConfiguration getConfiguration() {
return configuration;
}
+ /**
+ * Returns the MCP tool provider filter from this agent's configuration,
if configured.
+ *
+ * @return the filter predicate, or {@code null} when no filter is
configured
+ */
+ public BiPredicate<McpClient, ToolSpecification>
getMcpToolProviderFilter() {
+ return configuration.getMcpToolProviderFilter();
+ }
+
/**
* Gets the response format for structured output.
*
Review Comment:
Non-blocking design question: `getConfiguration()` is `protected` (line 60),
but this new `getMcpToolProviderFilter()` is `public` — creating an asymmetric
accessor surface. This works, but alternatively the producer's
`resolveMcpToolProviderFilter()` could cast to `AbstractAgent` and call
`getConfiguration().getMcpToolProviderFilter()` directly, keeping this method
`protected` (or removing it entirely). Either approach is valid — just flagging
for consideration.
##########
components/camel-ai/camel-langchain4j-agent/src/main/docs/langchain4j-agent-mcp.adoc:
##########
@@ -262,6 +262,8 @@ YAML::
Both `mcpClients` (bean references) and `mcpServer` (inline) can be used
together on the same endpoint. All tool sources -- Camel route tools,
endpoint-level MCP tools, and agent-level MCP tools -- are automatically
composed into a single tool provider.
+When MCP clients are configured at the endpoint level, the same
`withMcpToolProviderFilter(...)` predicate configured on the endpoint's
`agentConfiguration` (or on a registry `AbstractAgent` bean) is applied to
those clients as well. This keeps filtering behavior consistent regardless of
whether MCP clients are declared on the agent or on the endpoint URI.
Review Comment:
This doc change triggers a catalog regeneration. The generated copy at
`catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/langchain4j-agent-mcp.adoc`
needs to be regenerated and committed — CI currently fails on the "uncommitted
changes" check.
Run `mvn clean install -Dquickly` from the repository root and commit the
updated generated file.
--
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]