MCPcopy
hub / github.com/TanStack/ai / findMessageIdForToolCall

Method findMessageIdForToolCall

packages/ai-client/src/chat-client.ts:578–588  ·  view source on GitHub ↗
(toolCallId: string)

Source from the content-addressed store, hash-verified

576 }
577
578 private findMessageIdForToolCall(toolCallId: string): string | undefined {
579 const messages = this.processor.getMessages()
580 for (const message of messages) {
581 const match = message.parts.find(
582 (part: MessagePart): part is ToolCallPart =>
583 part.type === 'tool-call' && part.id === toolCallId,
584 )
585 if (match) return message.id
586 }
587 return undefined
588 }
589
590 private abortSubscriptionLoop(): void {
591 this.subscriptionAbortController?.abort()

Callers 1

constructorMethod · 0.95

Calls 1

getMessagesMethod · 0.45

Tested by

no test coverage detected