Croway commented on code in PR #20976: URL: https://github.com/apache/camel/pull/20976#discussion_r2716287468
########## dsl/camel-jbang/camel-jbang-mcp/src/main/java/org/apache/camel/dsl/jbang/core/commands/mcp/ExplainTools.java: ########## @@ -0,0 +1,212 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.dsl.jbang.core.commands.mcp; + +import java.util.Arrays; +import java.util.List; + +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; + +import dev.langchain4j.model.chat.ChatModel; +import io.quarkiverse.mcp.server.Tool; +import io.quarkiverse.mcp.server.ToolArg; +import io.quarkiverse.mcp.server.ToolCallException; +import org.apache.camel.catalog.CamelCatalog; +import org.apache.camel.catalog.DefaultCamelCatalog; +import org.apache.camel.tooling.model.ComponentModel; +import org.apache.camel.tooling.model.EipModel; +import org.apache.camel.util.json.JsonObject; + +/** + * MCP Tool for explaining Camel routes using AI/LLM services. + * <p> + * The LLM is configured at the application level via application.properties. Supported configurations include: + * <ul> + * <li>Ollama: quarkus.langchain4j.ollama.*</li> + * <li>OpenAI: quarkus.langchain4j.openai.*</li> + * </ul> + */ +@ApplicationScoped +public class ExplainTools { Review Comment: Now I do understand why the ollama dependency is needed, but I think this is wrong, or I am missing something (most probably). This MCP is used by an LLM (let's say gpt), therefore the sequence diagram would look like: `gpt -> call explain tools -> use ollama to explain -> back to gpt` The caller LLM is able to (or at least should be) explain the route, maybe the explain tools may provide some additional information only? `gpt -> explain tool -> back to gpt with additional context` I do not think an MCP Server should depend on an LLM implementation (ChatModel) -- 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]
