The text of the first content block, asserting it is a text block.
(result: CallToolResult)
| 66 | |
| 67 | /** The text of the first content block, asserting it is a text block. */ |
| 68 | function 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 | |
| 75 | describe('MCPAppResource', () => { |
| 76 | beforeEach(() => { |