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

Function getToolOutput

testing/e2e/tests/tools-test/runtime-context.spec.ts:28–42  ·  view source on GitHub ↗
(page: Page, name: string)

Source from the content-addressed store, hash-verified

26})
27
28async function getToolOutput(page: Page, name: string) {
29 const text = await page.locator('#messages-json-content').textContent()
30 const messages = z.array(MessageSchema).parse(JSON.parse(text || '[]'))
31
32 for (const message of messages) {
33 for (const partData of message.parts ?? []) {
34 const part = ToolCallPartSchema.safeParse(partData)
35 if (part.success && part.data.name === name && part.data.output) {
36 return part.data.output
37 }
38 }
39 }
40
41 return undefined
42}
43
44async function getRuntimeContextOutput(page: Page, name: string) {
45 const output = await getToolOutput(page, name)

Callers 1

getRuntimeContextOutputFunction · 0.85

Calls 1

parseMethod · 0.80

Tested by

no test coverage detected