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

Function firstText

packages/ai-react/tests/mcp-apps.test.tsx:68–73  ·  view source on GitHub ↗

The text of the first content block, asserting it is a text block.

(result: CallToolResult)

Source from the content-addressed store, hash-verified

66
67/** The text of the first content block, asserting it is a text block. */
68function firstText(result: CallToolResult): string {
69 const block = result.content[0]
70 expect(block?.type).toBe('text')
71 if (block?.type !== 'text') throw new Error('expected a text content block')
72 return block.text
73}
74
75describe('MCPAppResource', () => {
76 beforeEach(() => {

Callers 1

mcp-apps.test.tsxFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected