MCPcopy Index your code
hub / github.com/TanStack/ai / getToolCalls

Function getToolCalls

testing/e2e/tests/helpers.ts:101–116  ·  view source on GitHub ↗
(
  page: Page,
)

Source from the content-addressed store, hash-verified

99}
100
101export async function getToolCalls(
102 page: Page,
103): Promise<Array<{ name: string }>> {
104 const toolCalls: Array<{ name: string }> = []
105 const elements = page.locator('[data-testid^="tool-call-"]').filter({
106 hasNot: page.locator('[data-testid^="tool-call-result-"]'),
107 })
108 const count = await elements.count()
109 for (let i = 0; i < count; i++) {
110 const testId = await elements.nth(i).getAttribute('data-testid')
111 if (testId && testId.startsWith('tool-call-')) {
112 toolCalls.push({ name: testId.replace('tool-call-', '') })
113 }
114 }
115 return toolCalls
116}
117
118export async function getStructuredOutput(page: Page): Promise<string> {
119 return page.getByTestId('structured-output').innerText()

Calls 4

countMethod · 0.80
getAttributeMethod · 0.80
replaceMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected