MCPcopy Create free account
hub / github.com/anus-dev/ANUS / handlePendingFunctionCall

Method handlePendingFunctionCall

packages/core/src/core/turn.ts:285–306  ·  view source on GitHub ↗
(
    fnCall: FunctionCall,
  )

Source from the content-addressed store, hash-verified

283 }
284
285 private handlePendingFunctionCall(
286 fnCall: FunctionCall,
287 ): ServerAnusStreamEvent | null {
288 const callId =
289 fnCall.id ??
290 `${fnCall.name}-${Date.now()}-${Math.random().toString(16).slice(2)}`;
291 const name = fnCall.name || 'undefined_tool_name';
292 const args = (fnCall.args || {}) as Record<string, unknown>;
293
294 const toolCallRequest: ToolCallRequestInfo = {
295 callId,
296 name,
297 args,
298 isClientInitiated: false,
299 prompt_id: this.prompt_id,
300 };
301
302 this.pendingToolCalls.push(toolCallRequest);
303
304 // Yield a request for the tool call, not the pending/confirming status
305 return { type: AnusEventType.ToolCallRequest, value: toolCallRequest };
306 }
307
308 getDebugResponses(): GenerateContentResponse[] {
309 return this.debugResponses;

Callers 1

runMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected