fix(mcp): support resource content type in MCP tool output (#7879)

This commit is contained in:
Andrey Taranov
2026-01-12 03:39:42 +00:00
committed by GitHub
parent 7cbec9a1a7
commit 8b9a85b7e7

View File

@@ -777,8 +777,23 @@ export namespace SessionPrompt {
mime: contentItem.mimeType,
url: `data:${contentItem.mimeType};base64,${contentItem.data}`,
})
} else if (contentItem.type === "resource") {
const { resource } = contentItem
if (resource.text) {
textParts.push(resource.text)
}
if (resource.blob) {
attachments.push({
id: Identifier.ascending("part"),
sessionID: input.session.id,
messageID: input.processor.message.id,
type: "file",
mime: resource.mimeType ?? "application/octet-stream",
url: `data:${resource.mimeType ?? "application/octet-stream"};base64,${resource.blob}`,
filename: resource.uri,
})
}
}
// Add support for other types if needed
}
return {