MCPcopy Index your code
hub / github.com/Fission-AI/OpenSpec / validateTools

Method validateTools

src/core/init.ts:446–478  ·  view source on GitHub ↗
(
    toolIds: string[],
    toolStates: Map<string, ToolSkillStatus>
  )

Source from the content-addressed store, hash-verified

444 }
445
446 private validateTools(
447 toolIds: string[],
448 toolStates: Map<string, ToolSkillStatus>
449 ): Array<{ value: string; name: string; skillsDir: string; wasConfigured: boolean }> {
450 const validatedTools: Array<{ value: string; name: string; skillsDir: string; wasConfigured: boolean }> = [];
451
452 for (const toolId of toolIds) {
453 const tool = AI_TOOLS.find((t) => t.value === toolId);
454 if (!tool) {
455 const validToolIds = getToolsWithSkillsDir();
456 throw new Error(
457 `Unknown tool '${toolId}'. Valid tools:\n ${validToolIds.join('\n ')}`
458 );
459 }
460
461 if (!tool.skillsDir) {
462 const validToolsWithSkills = getToolsWithSkillsDir();
463 throw new Error(
464 `Tool '${toolId}' does not support skill generation.\nTools with skill generation support:\n ${validToolsWithSkills.join('\n ')}`
465 );
466 }
467
468 const preState = toolStates.get(tool.value);
469 validatedTools.push({
470 value: tool.value,
471 name: tool.name,
472 skillsDir: tool.skillsDir,
473 wasConfigured: preState?.configured ?? false,
474 });
475 }
476
477 return validatedTools;
478 }
479
480 // ═══════════════════════════════════════════════════════════
481 // DIRECTORY STRUCTURE

Callers 1

executeMethod · 0.95

Calls 2

getToolsWithSkillsDirFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected