From c926f2e1142a770b5771248e4ed8d28d2245f7f8 Mon Sep 17 00:00:00 2001 From: Ondrej Metelka Date: Thu, 12 Feb 2026 10:10:33 +0100 Subject: [PATCH 1/4] Add truncated tool status and MCP app fields to types and streaming Extend the Tool type with a 'truncated' status and optional MCP app metadata fields (uiResourceUri, serverName, structuredContent). Wire the streaming parser in Prompt.tsx to extract these fields from tool_result events and dispatch them into the Redux store. Co-authored-by: Cursor --- src/components/Prompt.tsx | 19 +++++++++++++++++-- src/types.ts | 6 +++++- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/components/Prompt.tsx b/src/components/Prompt.tsx index 6781d7fe..3e534b5d 100644 --- a/src/components/Prompt.tsx +++ b/src/components/Prompt.tsx @@ -573,8 +573,23 @@ const Prompt: React.FC = ({ scrollIntoView }) => { const { args, id, name: toolName } = json.data; dispatch(chatHistoryUpdateTool(chatEntryID, id, { name: toolName, args })); } else if (json.event === 'tool_result') { - const { content, id, status } = json.data; - dispatch(chatHistoryUpdateTool(chatEntryID, id, { content, status })); + const { + content, + id, + status, + ui_resource_uri: uiResourceUri, + server_name: serverName, + structured_content: structuredContent, + } = json.data; + dispatch( + chatHistoryUpdateTool(chatEntryID, id, { + content, + status, + ...(uiResourceUri && { uiResourceUri }), + ...(serverName && { serverName }), + ...(structuredContent && { structuredContent }), + }), + ); } else if (json.event === 'error') { dispatch( chatHistoryUpdateByID(chatEntryID, { diff --git a/src/types.ts b/src/types.ts index 3008eaba..ad9fd387 100644 --- a/src/types.ts +++ b/src/types.ts @@ -30,7 +30,11 @@ export type Tool = { args: { [key: string]: Array }; content: string; name: string; - status: 'error' | 'success'; + status: 'error' | 'success' | 'truncated'; + // MCP app fields (optional - present when tool provides UI) + uiResourceUri?: string; + serverName?: string; + structuredContent?: Record; }; type ChatEntryUser = { From 132ae0cf911a9ef29129dc656ae972505ae8f14c Mon Sep 17 00:00:00 2001 From: Ondrej Metelka Date: Thu, 12 Feb 2026 10:10:58 +0100 Subject: [PATCH 2/4] Color-code tool labels by status and type Tool labels in the chat are now color-coded: red for errors, yellow for truncated output, blue for tools with an MCP App UI, and grey (default) for standard tools. Co-authored-by: Cursor --- src/components/ResponseTools.tsx | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/src/components/ResponseTools.tsx b/src/components/ResponseTools.tsx index a787af8e..0bf56df5 100644 --- a/src/components/ResponseTools.tsx +++ b/src/components/ResponseTools.tsx @@ -2,7 +2,7 @@ import { Map as ImmutableMap } from 'immutable'; import * as React from 'react'; import { useDispatch, useSelector } from 'react-redux'; import { Label, LabelGroup } from '@patternfly/react-core'; -import { CodeIcon, InfoCircleIcon } from '@patternfly/react-icons'; +import { CodeIcon, ExternalLinkAltIcon, InfoCircleIcon } from '@patternfly/react-icons'; import { openToolSet } from '../redux-actions'; import { State } from '../redux-reducers'; @@ -23,16 +23,25 @@ const ToolLabel: React.FC = ({ entryIndex, toolID }) => { dispatch(openToolSet(entryIndex, toolID)); }, [dispatch, entryIndex, toolID]); - const isError = tool.get('status') === 'error'; + const status = tool.get('status') as string | undefined; + const isError = status === 'error'; + const isTruncated = status === 'truncated'; + const hasUI = !!tool.get('uiResourceUri'); + + const color = isError ? 'red' : isTruncated ? 'yellow' : hasUI ? 'blue' : undefined; + const icon = isError ? ( + + ) : isTruncated ? ( + + ) : hasUI ? ( + + ) : ( + + ); return ( -