@maxhealth.tech/prefab / mcp / display_a2ui
Function: display_a2ui()
ts
function display_a2ui(viewOrApp, options?): McpDisplayResult<A2uiMessageList>;Defined in: mcp/a2ui.ts:93
Return a view as an A2UI tool result.
The messages travel as an EmbeddedResource in content, which is where a host looks for a payload it should route to its A2UI renderer, and as structuredContent for hosts that read results structurally.
Parameters
| Parameter | Type |
|---|---|
viewOrApp | Component | PrefabApp |
options? | DisplayA2uiOptions |
Returns
McpDisplayResult<A2uiMessageList>
Example
ts
import { display_a2ui } from '@maxhealth.tech/prefab/mcp'
import { autoTable } from '@maxhealth.tech/prefab'
server.registerTool('list-users', schema, async () =>
display_a2ui(autoTable(await db.users())))