Add MCP tool catalog functionality and validation

- Implement AnyCatalog method in MCPController to list MCP tools with detailed information.
- Introduce MCPToolCatalogResponse struct for tool catalog responses.
- Create ToolCatalogService to handle tool listing and validation of tool codes.
- Enhance skill definition validation to include tool code validation against the catalog.
This commit is contained in:
mlogclub
2026-04-09 15:24:34 +08:00
parent dbd1c5fe66
commit 92490d7faf
4 changed files with 123 additions and 1 deletions
@@ -257,9 +257,15 @@ func validateSkillDefinitionRequest(req request.CreateSkillDefinitionRequest) er
if _, err := normalizeJSONStringArray(req.Examples); err != nil {
return err
}
if _, err := normalizeJSONStringArray(req.AllowedToolCodes); err != nil {
allowedToolCodes, err := normalizeJSONStringArray(req.AllowedToolCodes)
if err != nil {
return err
}
for _, toolCode := range allowedToolCodes {
if err := services.ToolCatalogService.ValidateMCPToolCode(toolCode); err != nil {
return err
}
}
return nil
}