(content: CallToolResult['content'][number])
| 46 | } |
| 47 | |
| 48 | export function getImageContent(content: CallToolResult['content'][number]): { |
| 49 | data: string; |
| 50 | mimeType: string; |
| 51 | } { |
| 52 | if (content.type === 'image') { |
| 53 | return {data: content.data, mimeType: content.mimeType}; |
| 54 | } |
| 55 | throw new Error(`Expected image content but got ${content.type}`); |
| 56 | } |
| 57 | |
| 58 | export function extractExtensionId(response: McpResponse) { |
| 59 | const responseLine = response.responseLines[0]; |