(content: {
uri?: string
text?: string
blob?: string
[key: string]: unknown
})
| 8 | * - otherwise → `{ type: 'text', content: JSON.stringify(content) }` |
| 9 | */ |
| 10 | export function mcpResourceToContentPart(content: { |
| 11 | uri?: string |
| 12 | text?: string |
| 13 | blob?: string |
| 14 | [key: string]: unknown |
| 15 | }): ContentPart { |
| 16 | if (typeof content.text === 'string') { |
| 17 | return { type: 'text', content: content.text } |
| 18 | } |
| 19 | if (typeof content.blob === 'string') { |
| 20 | return { type: 'text', content: `[binary resource ${content.uri ?? ''}]` } |
| 21 | } |
| 22 | return { type: 'text', content: JSON.stringify(content) } |
| 23 | } |
no outgoing calls
no test coverage detected