atiaomar1978-hub commented on code in PR #25037:
URL: https://github.com/apache/camel/pull/25037#discussion_r3639667353


##########
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:
   Fixed in 9b35ad727ef7 — regenerated and committed 
\catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/langchain4j-agent-mcp.adoc\
 with the endpoint-level \mcpToolProviderFilter\ paragraph.
   
   _AI-generated comment on behalf of atiaomar1978-hub_



##########
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:
   Addressed in d5eabcd71b90 — removed the public \getMcpToolProviderFilter()\ 
instance accessor and added 
\AbstractAgent.mcpToolProviderFilter(AbstractAgent<?>)\ static helper instead. 
The producer now resolves the filter via that helper, which reads the protected 
\getConfiguration()\ internally. This keeps the accessor surface consistent 
without exposing configuration directly.
   
   _AI-generated comment on behalf of atiaomar1978-hub_



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