MCPcopy Create free account
hub / github.com/echoVic/blade-code / setToolEnabled

Method setToolEnabled

src/tools/ToolManager.ts:126–136  ·  view source on GitHub ↗

* 启用/禁用工具

(toolName: string, enabled: boolean)

Source from the content-addressed store, hash-verified

124 * 启用/禁用工具
125 */
126 public setToolEnabled(toolName: string, enabled: boolean): void {
127 const state = this.toolStates.get(toolName);
128 if (!state) {
129 throw new ToolRegistrationError(`工具 "${toolName}" 不存在`, toolName);
130 }
131
132 state.enabled = enabled;
133 this.log(`工具 "${toolName}" ${enabled ? '已启用' : '已禁用'}`);
134
135 this.emit('toolStateChanged', { toolName, enabled });
136 }
137
138 /**
139 * 检查工具是否启用

Callers

nothing calls this directly

Calls 3

logMethod · 0.95
getMethod · 0.80
emitMethod · 0.45

Tested by

no test coverage detected