summaryrefslogtreecommitdiff
path: root/packages/core/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/core/src')
-rw-r--r--packages/core/src/tools/tool-registry.ts12
1 files changed, 12 insertions, 0 deletions
diff --git a/packages/core/src/tools/tool-registry.ts b/packages/core/src/tools/tool-registry.ts
index 02f77727..b3625285 100644
--- a/packages/core/src/tools/tool-registry.ts
+++ b/packages/core/src/tools/tool-registry.ts
@@ -159,6 +159,18 @@ export class ToolRegistry {
}
/**
+ * Removes all tools from a specific MCP server.
+ * @param serverName The name of the server to remove tools from.
+ */
+ removeMcpToolsByServer(serverName: string): void {
+ for (const [name, tool] of this.tools.entries()) {
+ if (tool instanceof DiscoveredMCPTool && tool.serverName === serverName) {
+ this.tools.delete(name);
+ }
+ }
+ }
+
+ /**
* Discovers tools from project (if available and configured).
* Can be called multiple times to update discovered tools.
* This will discover tools from the command line and from MCP servers.