Skip to content

Commit c9c27cd

Browse files
Address reviewed comments
1 parent 7c6e473 commit c9c27cd

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/customservice/synapse/mediatorService/AIConnectorHandler.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ private List<ExistingTool> extractExistingTools(DOMDocument document, DOMNode to
271271
* @param targetConnection the name of the MCP connection to attach to the tool
272272
* @return a rendered XML string for the new \<tool/> element
273273
*/
274-
private String createNewToolXml(String toolName, String targetConnection) {
274+
private String createNewMCPToolXml(String toolName, String targetConnection) {
275275

276276
Map<String, Object> toolData = new HashMap<>();
277277
toolData.put(TOOL_NAME, toolName);
@@ -1090,7 +1090,7 @@ private String buildMergedToolsXml(DOMDocument document, DOMNode toolsNode, Stri
10901090

10911091
for (String toolName : selectedTools) {
10921092
if (!existingNamesForConnection.contains(toolName)) {
1093-
String newToolXml = createNewToolXml(toolName, targetConnection);
1093+
String newToolXml = createNewMCPToolXml(toolName, targetConnection);
10941094
finalXMLs.add(newToolXml);
10951095
}
10961096
}
@@ -1130,7 +1130,7 @@ private String buildUpdatedToolsXml(DOMDocument document, DOMNode toolsNode, Str
11301130
}
11311131

11321132
for (String toolName : remaining) {
1133-
String newToolXml = createNewToolXml(toolName, targetConnection);
1133+
String newToolXml = createNewMCPToolXml(toolName, targetConnection);
11341134
finalXMLs.add(newToolXml);
11351135
}
11361136
return generateToolsXmlFromStrings(finalXMLs);

org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/customservice/synapse/syntaxTree/factory/mediators/ai/AIAgentConnectorFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ private void populateTools(AIAgent aiAgent, DOMElement element) {
6565
List<DOMNode> toolElements = toolsElement.getChildren();
6666
for (DOMNode toolElement : toolElements) {
6767
if (toolElement instanceof DOMElement && Constant.TOOL.equals(toolElement.getNodeName())) {
68-
if(toolElement.hasAttribute(Constant.TYPE)){
68+
if(toolElement.hasAttribute(Constant.TYPE) && Constant.MCP.equals(toolElement.getAttribute(Constant.TYPE))) {
6969
AgentTool agentTool = new AgentTool();
7070
agentTool.elementNode((DOMElement) toolElement);
7171
agentTool.setName(toolElement.getAttribute(Constant.NAME));

org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/customservice/synapse/utils/Constant.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public class Constant {
3838
public static final String METHODS = "methods";
3939
public static final String SEQUENCE = "sequence";
4040
public static final String TYPE = "type";
41+
public static final String MCP = "mcp";
4142
public static final String MAX_SIZE = "maxSize";
4243
public static final String TARGET = "target";
4344
public static final String SOURCE = "source";

0 commit comments

Comments
 (0)