// Server: return a typed payload alongside the text fallback
const flights = await searchFlights(route);
return {
content: [
{ type: "text" as const, text: flights.summary },
createViewContentBlock({
uri: `a2ui://flight-server/surfaces/${encodeURIComponent(route)}`,
mimeType: A2UI_MIME_TYPE,
text: buildA2uiSurface(route),
}),
],
};
getViewContentBlocks for the view-side extraction helper
Create an embedded resource content block marked as dynamic view content.
Servers include the returned block in
CallToolResult.content. Hosts that negotiated dynamic content support (a non-emptycontentMimeTypesextension setting) forward it unmodified to the calling tool's view and exclude it from model context. Servers should not rely on delivery when support was not negotiated; seesupportsContentMimeType.