MCPcopy Index your code
hub / github.com/coder/mux / setToolAllowlist

Method setToolAllowlist

src/node/services/mcpConfigService.ts:333–353  ·  view source on GitHub ↗
(name: string, toolAllowlist: string[])

Source from the content-addressed store, hash-verified

331 }
332
333 async setToolAllowlist(name: string, toolAllowlist: string[]): Promise<Result<void>> {
334 const cfg = await this.getGlobalConfig();
335 const entry = cfg.servers[name];
336 if (!entry) {
337 return Err(`Server ${name} not found`);
338 }
339
340 // [] = no tools allowed, [...tools] = those tools allowed
341 cfg.servers[name] = {
342 ...entry,
343 toolAllowlist,
344 };
345
346 try {
347 await this.saveGlobalConfig(cfg);
348 return Ok(undefined);
349 } catch (error) {
350 log.error("Failed to update MCP server tool allowlist", { name, error });
351 return Err(getErrorMessage(error));
352 }
353 }
354}

Callers 2

ToolAllowlistSectionFunction · 0.80
routerFunction · 0.80

Calls 5

getGlobalConfigMethod · 0.95
saveGlobalConfigMethod · 0.95
ErrFunction · 0.90
OkFunction · 0.90
getErrorMessageFunction · 0.90

Tested by

no test coverage detected