MCPcopy Index your code
hub / github.com/getsentry/XcodeBuildMCP / tryImportToolModule

Function tryImportToolModule

src/utils/tool-registry.ts:372–389  ·  view source on GitHub ↗
(
  toolManifest: ToolManifestEntry,
  cache: Map<string, ImportedToolModule>,
)

Source from the content-addressed store, hash-verified

370}
371
372async function tryImportToolModule(
373 toolManifest: ToolManifestEntry,
374 cache: Map<string, ImportedToolModule>,
375): Promise<ImportedToolModule | undefined> {
376 const cached = cache.get(toolManifest.id);
377 if (cached) {
378 return cached;
379 }
380
381 try {
382 const toolModule = await importToolModule(toolManifest.module);
383 cache.set(toolManifest.id, toolModule);
384 return toolModule;
385 } catch (err) {
386 log('warn', `Failed to import tool module ${toolManifest.module}: ${err}`);
387 return undefined;
388 }
389}
390
391function toCatalogTool(
392 toolManifest: ToolManifestEntry,

Callers 1

Calls 3

importToolModuleFunction · 0.90
logFunction · 0.90
getMethod · 0.80

Tested by

no test coverage detected