fix: supportedShellTools not right

This commit is contained in:
ReaJason
2025-09-12 22:51:50 +08:00
parent 0626657991
commit be29e9dcc0
3 changed files with 35 additions and 1 deletions
@@ -235,7 +235,10 @@ public class ServerFactory {
}
toolMappingBuilder.addShellClass(shellType, shellClass);
}
server.addToolMapping(shellTool, toolMappingBuilder.build());
ToolMapping mapping = toolMappingBuilder.build();
if (mapping.isNotEmpty()) {
server.addToolMapping(shellTool, mapping);
}
}
}
@@ -24,6 +24,10 @@ public class ToolMapping {
this.shellClassMap = new LinkedHashMap<>(shellClassMap);
}
public boolean isNotEmpty() {
return !shellClassMap.isEmpty();
}
public Set<String> getSupportedShellTypes() {
return shellClassMap.keySet();
}