MCPcopy Create free account
hub / github.com/CreminiAI/skillpack / createCustomTools

Method createCustomTools

src/runtime/agent.ts:470–492  ·  view source on GitHub ↗
(
    adapter: RuntimePlatform,
    channelId: string,
    fileOutputCallbackRef: { current: FileOutputCallback | null },
    delegatedToolRunContextRef: DelegatedToolRunContextRef,
  )

Source from the content-addressed store, hash-verified

468 }
469
470 private async createCustomTools(
471 adapter: RuntimePlatform,
472 channelId: string,
473 fileOutputCallbackRef: { current: FileOutputCallback | null },
474 delegatedToolRunContextRef: DelegatedToolRunContextRef,
475 ): Promise<any[]> {
476 const delegatedDefinitions =
477 await this.delegatedCustomToolClient.listDefinitions();
478 const tools = [
479 createSendFileTool(fileOutputCallbackRef) as any,
480 ...createDelegatedCustomTools(
481 delegatedDefinitions,
482 this.delegatedCustomToolClient,
483 delegatedToolRunContextRef,
484 ),
485 ];
486 if (adapter !== "scheduler") {
487 tools.push(
488 createManageScheduleTool(this.schedulerRef, adapter, channelId) as any,
489 );
490 }
491 return tools;
492 }
493
494 /**
495 * Lazily create (or return existing) session for a channel.

Callers 1

getOrCreateSessionMethod · 0.95

Calls 4

createSendFileToolFunction · 0.85
createManageScheduleToolFunction · 0.85
listDefinitionsMethod · 0.80

Tested by

no test coverage detected