MCPcopy Create free account
hub / github.com/TanStack/ai / hasToolCalls

Function hasToolCalls

testing/panel/tests/helpers.ts:229–240  ·  view source on GitHub ↗
(page: Page)

Source from the content-addressed store, hash-verified

227 * Check if the last message has tool calls
228 */
229export async function hasToolCalls(page: Page): Promise<boolean> {
230 const messages = await getMessages(page)
231 for (let i = messages.length - 1; i >= 0; i--) {
232 if (messages[i].role === 'assistant') {
233 const toolCalls = messages[i].parts?.filter(
234 (p: any) => p.type === 'tool-call',
235 )
236 return toolCalls?.length > 0
237 }
238 }
239 return false
240}
241
242/**
243 * Get tool call names from the last assistant message

Callers 1

tool-flow.spec.tsFile · 0.90

Calls 1

getMessagesFunction · 0.70

Tested by

no test coverage detected