MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / dispatchToolCall

Function dispatchToolCall

packages/agent-core/src/loop/tool-call.ts:698–717  ·  view source on GitHub ↗

* Record `tool.call` in provider order. Reusing the provider/API tool-call id * keeps transcript linkage on one canonical identity.

(
  step: ToolCallStepContext,
  call: PreflightedToolCall,
  args: unknown,
  displayFields?: ToolCallDisplayFields | undefined,
)

Source from the content-addressed store, hash-verified

696 * keeps transcript linkage on one canonical identity.
697 */
698async function dispatchToolCall(
699 step: ToolCallStepContext,
700 call: PreflightedToolCall,
701 args: unknown,
702 displayFields?: ToolCallDisplayFields | undefined,
703): Promise<void> {
704 const { toolCall, toolName } = call;
705 await step.dispatchEvent({
706 type: 'tool.call',
707 uuid: toolCall.id,
708 turnId: step.turnId,
709 step: step.currentStep,
710 stepUuid: step.stepUuid,
711 toolCallId: toolCall.id,
712 name: toolName,
713 args,
714 description: displayFields?.description,
715 display: displayFields?.display,
716 });
717}

Callers 4

settleErrorFunction · 0.85
settleSyntheticFunction · 0.85
prepareToolCallFunction · 0.85
prepareSkippedToolCallFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected