MCPcopy Create free account
hub / github.com/ChromeDevTools/chrome-devtools-mcp / update

Method update

src/ToolHandler.ts:289–314  ·  view source on GitHub ↗

* Replaces the tool definition and re-evaluates its status against the * current server config. Callers must pause the task runner, so calls that * are already waiting run with the new state. Returns true if the tool * listing visible to the client changed.

(tool: AnyToolDefinition)

Source from the content-addressed store, hash-verified

287 * listing visible to the client changed.
288 */
289 update(tool: AnyToolDefinition): boolean {
290 const previousTool = this.#tool;
291 const previousDisabled = this.#disabled;
292 const previousInputSchema = this.#registeredInputSchema;
293 const nextInputSchema = zod.object(tool.schema).strict();
294
295 this.#tool = tool;
296 this.#registeredInputSchema = nextInputSchema;
297 this.#updateStatus(tool);
298
299 if (previousDisabled !== this.#disabled) {
300 return true;
301 }
302 if (this.#disabled) {
303 return false;
304 }
305
306 return (
307 previousTool.description !== tool.description ||
308 !isDeepStrictEqual(previousTool.annotations, tool.annotations) ||
309 !isDeepStrictEqual(
310 toInputJsonSchema(previousInputSchema),
311 toInputJsonSchema(nextInputSchema),
312 )
313 );
314 }
315
316 /**
317 * Races a promise against TOOL_CALL_TIMEOUT_MS and signal abort, calling

Callers 2

#applyConfigLockedMethod · 0.80

Calls 2

#updateStatusMethod · 0.95
toInputJsonSchemaFunction · 0.85

Tested by

no test coverage detected