MCPcopy Create free account
hub / github.com/Noumena-Network/code / call

Function call

src/tools/SkillTool/SkillTool.ts:581–842  ·  view source on GitHub ↗
(
    { skill, args },
    context,
    canUseTool,
    parentMessage,
    onProgress?,
  )

Source from the content-addressed store, hash-verified

579 },
580
581 async call(
582 { skill, args },
583 context,
584 canUseTool,
585 parentMessage,
586 onProgress?,
587 ): Promise<ToolResult<Output>> {
588 // At this point, validateInput has already confirmed:
589 // - Skill format is valid
590 // - Skill exists
591 // - Skill can be loaded
592 // - Skill doesn't have disableModelInvocation
593 // - Skill is a prompt-based skill
594
595 // Skills are just names, with optional arguments
596 const trimmed = skill.trim()
597
598 // Remove leading slash if present (for compatibility)
599 const commandName = trimmed.startsWith('/') ? trimmed.substring(1) : trimmed
600
601 // Remote canonical skill execution (ant-only experimental). Intercepts
602 // `_canonical_<slug>` before local command lookup — loads SKILL.md from
603 // AKI/GCS (with local cache), injects content directly as a user message.
604 // Remote skills are declarative markdown so no slash-command expansion
605 // (no !command substitution, no $ARGUMENTS interpolation) is needed.
606 if (
607 feature('EXPERIMENTAL_SKILL_SEARCH') &&
608 isInternalBuild()
609 ) {
610 const slug = remoteSkillModules!.stripCanonicalPrefix(commandName)
611 if (slug !== null) {
612 return executeRemoteSkill(slug, commandName, parentMessage, context)
613 }
614 }
615
616 const commands = await getAllCommands(context)
617 const command = findCommand(commandName, commands)
618
619 // Track skill usage for ranking
620 recordSkillUsage(commandName)
621
622 // Check if skill should run as a forked sub-agent
623 if (command?.type === 'prompt' && command.context === 'fork') {
624 return executeForkedSkill(
625 command,
626 commandName,
627 args,
628 context,
629 canUseTool,
630 parentMessage,
631 onProgress,
632 )
633 }
634
635 // Process the skill with optional args
636 const { processPromptSlashCommand } = await import(
637 'src/utils/processUserInput/processSlashCommand.js'
638 )

Callers

nothing calls this directly

Calls 15

isInternalBuildFunction · 0.85
executeRemoteSkillFunction · 0.85
findCommandFunction · 0.85
executeForkedSkillFunction · 0.85
parsePluginIdentifierFunction · 0.85
getAgentContextFunction · 0.85
tagMessagesWithToolUseIDFunction · 0.85
getAllCommandsFunction · 0.70

Tested by

no test coverage detected