Repository navigation
Closed as duplicate
Labels
enhancementNew feature or request
Description
Context
MCP supports multiple content types in tool results. WebMCP should clarify how non-text content is handled.
MCP Content Types
// MCP tool results can include:
{
content: [
{ type: "text", text: "Search results..." },
{ type: "image", data: "base64...", mimeType: "image/png" },
{ type: "resource", uri: "file:///path/to/doc.pdf" }
]
}Current Gap
The WebMCP proposal doesn't specify:
- Which content types are supported
- How images/binary data should be returned
- How the browser/agent should render different types
Proposal
Define supported content types and their handling:
navigator.modelContext.provideContext({
tools: [{
name: "generate_chart",
description: "Generate a chart from data",
inputSchema: { ... },
execute: async (args) => {
const chartImage = await generateChart(args.data);
return {
content: [
{ type: "text", text: "Chart generated successfully" },
{
type: "image",
data: chartImage.toDataURL(), // or base64
mimeType: "image/png",
alt: "Bar chart showing sales data"
}
]
};
}
}]
});Proposed Content Types
| Type | Description | Fields |
|---|---|---|
text |
Plain text | text |
image |
Image data | data (base64/dataURL), mimeType, alt |
html |
Rich HTML snippet | html (sanitized) |
link |
Clickable reference | url, title |
table |
Structured data | headers, rows |
error |
Error message | message, code |
Security Considerations
- HTML content should be sanitized
- Images should have size limits
- External URLs should be validated
- No script execution in content
Benefits
- Richer tool results for visual applications (design tools, charts, etc.)
- Alignment with MCP content model
- Better user experience in human-in-the-loop workflows
This directly supports the "Creative" use case in the proposal where tools like editDesign would benefit from returning visual previews.
Reacted by Kenneth Rohde Christiansen and Enes Gules
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity
kenchris commentedon Mar 4, 2026
Is that the standard MCP way of doing that? Any reference?
"uri" as a name is unfortunately not very web'y :-)
bwalderman commentedon Mar 5, 2026
Related #41
hemanth commentedon Sep 26, 2026
Sure, that is just a proposal, we can webify it as per the need :) @kenchris
domfarolino commentedon Sep 28, 2026
I think the core valid requirement here is support for non-text / multimodal tool results, which is tracked by #41 (including both multimodal inputs and outputs), as @bwalderman mentions above.
I'm less convinced we should adopt MCP's content model directly, or standardize presentation-specific types like
html,table, orlinkas part of WebMCP.Given that, I'm going to close this in favor of #41 and continue the multimodal input/output design discussion there. Do you think the discussion in #41 adequately captures the real actionable bits of this issue, @hemanth?