From 847cabb964d3f669e7ee0f34190b060c7aa11871 Mon Sep 17 00:00:00 2001 From: Andrew Harvard Date: Wed, 7 Jan 2026 14:53:22 -0500 Subject: [PATCH] fix: update MCP Apps _meta.ui.resourceUri to use nested format (SEP-1865) (#6372) --- .../src/components/ToolCallWithResponse.tsx | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/ui/desktop/src/components/ToolCallWithResponse.tsx b/ui/desktop/src/components/ToolCallWithResponse.tsx index bbc5b990..9fce25ba 100644 --- a/ui/desktop/src/components/ToolCallWithResponse.tsx +++ b/ui/desktop/src/components/ToolCallWithResponse.tsx @@ -24,19 +24,21 @@ interface ToolGraphNode { depends_on: number[]; } +type UiMeta = { + ui?: { + resourceUri?: string; + }; +}; + type ToolResultWithMeta = { status?: string; value?: CallToolResponse & { - _meta?: { - 'ui/resourceUri'?: string; - }; + _meta?: UiMeta; }; }; type ToolRequestWithMeta = ToolRequestMessageContent & { - _meta?: { - 'ui/resourceUri'?: string; - }; + _meta?: UiMeta; toolCall: { status: 'success'; value: { @@ -85,12 +87,12 @@ function McpAppWrapper({ append, }: McpAppWrapperProps): React.ReactNode { const requestWithMeta = toolRequest as ToolRequestWithMeta; - let resourceUri = requestWithMeta._meta?.['ui/resourceUri']; + let resourceUri = requestWithMeta._meta?.ui?.resourceUri; if (!resourceUri && toolResponse) { const resultWithMeta = toolResponse.toolResult as ToolResultWithMeta; if (resultWithMeta?.status === 'success' && resultWithMeta.value) { - resourceUri = resultWithMeta.value._meta?.['ui/resourceUri']; + resourceUri = resultWithMeta.value._meta?.ui?.resourceUri; } }