{"record":{"id":"fca395c0b9f39794","repo":"ruvnet/ruflo","slug":"tool-not-found-name","errorCode":null,"errorMessage":"Tool not found: ${name}","messagePattern":"Tool not found: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/testing/src/v2-compat/compatibility-validator.ts","lineNumber":439,"sourceCode":"    ];\n\n    const v3Hooks = V2_HOOKS.map(h => h.v3Equivalent || h.name);\n\n    const v3Classes = ['UnifiedSwarmCoordinator', 'UnifiedMemoryService', 'AgentLifecycleService', 'TaskExecutionService'];\n\n    return {\n      cli: {\n        execute: vi.fn().mockImplementation(async (command: string) => {\n          const isSupported = v3Commands.some(c => c === command || command.startsWith(c.split(' ')[0]));\n          return { success: isSupported, output: isSupported ? 'OK' : 'Command not found' };\n        }),\n        getCommands: vi.fn().mockReturnValue(v3Commands),\n      },\n      mcp: {\n        callTool: vi.fn().mockImplementation(async (name: string) => {\n          const v3Name = toolNameMapping[name] || name;\n          const isSupported = v3Tools.includes(v3Name);\n          if (!isSupported) throw new Error(`Tool not found: ${name}`);\n          return { success: true };\n        }),\n        getTools: vi.fn().mockReturnValue(v3Tools),\n        translateToolName: vi.fn().mockImplementation((v2Name: string) => toolNameMapping[v2Name] || v2Name),\n      },\n      hooks: {\n        trigger: vi.fn().mockImplementation(async (name: string) => {\n          const isSupported = v3Hooks.includes(name);\n          return { handled: isSupported, result: isSupported ? {} : null };\n        }),\n        getHooks: vi.fn().mockReturnValue(v3Hooks),\n      },\n      api: {\n        getClass: vi.fn().mockImplementation((name: string) => {\n          const mapping: Record<string, { methods: string[] }> = {\n            'UnifiedSwarmCoordinator': { methods: ['initialize', 'spawn', 'addAgent', 'removeAgent', 'broadcast', 'consensus', 'getStatus', 'shutdown'] },\n            'UnifiedMemoryService': { methods: ['store', 'search', 'delete', 'clear', 'getStats'] },\n            'AgentLifecycleService': { methods: ['spawn', 'terminate', 'list', 'getInfo', 'getStatus'] },","sourceCodeStart":421,"sourceCodeEnd":457,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/testing/src/v2-compat/compatibility-validator.ts#L421-L457","documentation":"The v2-compatibility default mock service was asked for a tool by a name that is not in its v3-equivalent tools list. The mock only knows the tools mapped from v2, so any other tool name (typo or unmigrated v2 tool) produces this lookup failure in compatibility tests.","triggerScenarios":"Thrown at v3/@claude-flow/testing/src/v2-compat/compatibility-validator.ts:439 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Register the tool before invoking it in the compatibility test.","Check the tool name spelling against the registry."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}