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
+10
View File
@@ -65,6 +65,16 @@ func BuildMCPToolInfoResponses(items []mcps.ToolInfo) []MCPToolInfoResponse {
return ret
}
type MCPToolCatalogResponse struct {
ToolCode string `json:"toolCode"`
ServerCode string `json:"serverCode"`
ToolName string `json:"toolName"`
Title string `json:"title"`
Description string `json:"description"`
InputSchema any `json:"inputSchema"`
OutputSchema any `json:"outputSchema,omitempty"`
}
type MCPToolResultContentResponse struct {
Type string `json:"type"`
Text string `json:"text,omitempty"`