Added skills, shortcuts, and bugifixes++
This commit is contained in:
@@ -91,6 +91,8 @@ class MCPService {
|
||||
var canMoveFiles: Bool { settings.mcpCanMoveFiles }
|
||||
var respectGitignore: Bool { settings.mcpRespectGitignore }
|
||||
|
||||
private let anytypeService = AnytypeMCPService.shared
|
||||
|
||||
// MARK: - Tool Schema Generation
|
||||
|
||||
func getToolSchemas() -> [Tool] {
|
||||
@@ -189,6 +191,11 @@ class MCPService {
|
||||
))
|
||||
}
|
||||
|
||||
// Add Anytype tools if enabled and configured
|
||||
if settings.anytypeMcpEnabled && settings.anytypeMcpConfigured {
|
||||
tools.append(contentsOf: anytypeService.getToolSchemas())
|
||||
}
|
||||
|
||||
return tools
|
||||
}
|
||||
|
||||
@@ -213,7 +220,7 @@ class MCPService {
|
||||
|
||||
// MARK: - Tool Execution
|
||||
|
||||
func executeTool(name: String, arguments: String) -> [String: Any] {
|
||||
func executeTool(name: String, arguments: String) async -> [String: Any] {
|
||||
Log.mcp.info("Executing tool: \(name)")
|
||||
guard let argData = arguments.data(using: .utf8),
|
||||
let args = try? JSONSerialization.jsonObject(with: argData) as? [String: Any] else {
|
||||
@@ -303,6 +310,10 @@ class MCPService {
|
||||
return copyFile(source: source, destination: destination)
|
||||
|
||||
default:
|
||||
// Route anytype_* tools to AnytypeMCPService
|
||||
if name.hasPrefix("anytype_") {
|
||||
return await anytypeService.executeTool(name: name, arguments: arguments)
|
||||
}
|
||||
return ["error": "Unknown tool: \(name)"]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user