fix: Include local fallback tools in generateToolsMarkdown API
All checks were successful
Deploy to OCIWP / deploy (push) Successful in 6m15s
All checks were successful
Deploy to OCIWP / deploy (push) Successful in 6m15s
This commit is contained in:
@@ -112,9 +112,7 @@ public class McpRouterController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/tools/list")
|
private List<ToolMetadata> fetchAllActiveTools() {
|
||||||
public ResponseEntity<JsonRpcResponse> listTools(
|
|
||||||
@RequestParam(value = "categoryKey", required = false) String categoryKey) {
|
|
||||||
List<ToolMetadata> activeTools = redisRegistryService.getAllTools()
|
List<ToolMetadata> activeTools = redisRegistryService.getAllTools()
|
||||||
.stream()
|
.stream()
|
||||||
.filter(ToolMetadata::getVisible)
|
.filter(ToolMetadata::getVisible)
|
||||||
@@ -148,6 +146,14 @@ public class McpRouterController {
|
|||||||
log.warn("Failed to fetch local tools from fallback URL: {}", url);
|
log.warn("Failed to fetch local tools from fallback URL: {}", url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return activeTools;
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/tools/list")
|
||||||
|
public ResponseEntity<JsonRpcResponse> listTools(
|
||||||
|
@RequestParam(value = "categoryKey", required = false) String categoryKey) {
|
||||||
|
|
||||||
|
List<ToolMetadata> activeTools = fetchAllActiveTools();
|
||||||
|
|
||||||
if (categoryKey != null && !categoryKey.trim().isEmpty()) {
|
if (categoryKey != null && !categoryKey.trim().isEmpty()) {
|
||||||
activeTools = activeTools.stream()
|
activeTools = activeTools.stream()
|
||||||
@@ -161,12 +167,10 @@ public class McpRouterController {
|
|||||||
|
|
||||||
return ResponseEntity.ok(response);
|
return ResponseEntity.ok(response);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping(value = "/tools/docs/markdown", produces = "text/markdown;charset=UTF-8")
|
@GetMapping(value = "/tools/docs/markdown", produces = "text/markdown;charset=UTF-8")
|
||||||
public ResponseEntity<String> generateToolsMarkdown() {
|
public ResponseEntity<String> generateToolsMarkdown() {
|
||||||
List<ToolMetadata> tools = redisRegistryService.getAllTools()
|
List<ToolMetadata> tools = fetchAllActiveTools();
|
||||||
.stream()
|
|
||||||
.filter(ToolMetadata::getVisible)
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
|
|
||||||
StringBuilder md = new StringBuilder();
|
StringBuilder md = new StringBuilder();
|
||||||
md.append("# \uD83E\uDD16 Shinhan AI Tool Catalog\n\n");
|
md.append("# \uD83E\uDD16 Shinhan AI Tool Catalog\n\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user