From 444b1f4a6f30bf45a1c38460e19f89d35f9ccb8d Mon Sep 17 00:00:00 2001 From: aditya Date: Fri, 22 May 2026 02:47:52 +0530 Subject: [PATCH] fix(client): prefer .title over .name for prompt, resource, and template labels The MCP spec's `BaseMetadata` gives every named entity an optional `title` aimed at human-readable UI display; `name` is the programmatic identifier. The Tools tab already followed the idiomatic `title || name` pattern, but PromptsTab and ResourcesTab (including resource templates) rendered the raw `name` even when a title was available. Mirror the ToolsTab pattern for parity. Also adds the already-spec'red `title?: string` field to the local `Prompt` type in PromptsTab.tsx (SDK types for Resource and ResourceTemplate already carry it). Closes #1226, closes #1227. --- client/src/components/PromptsTab.tsx | 7 +++++-- client/src/components/ResourcesTab.tsx | 15 ++++++++++----- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/client/src/components/PromptsTab.tsx b/client/src/components/PromptsTab.tsx index fd28a386b..4c08110b0 100644 --- a/client/src/components/PromptsTab.tsx +++ b/client/src/components/PromptsTab.tsx @@ -18,6 +18,7 @@ import IconDisplay, { WithIcons } from "./IconDisplay"; export type Prompt = { name: string; + title?: string; description?: string; arguments?: { name: string; @@ -120,7 +121,7 @@ const PromptsTab = ({
- {prompt.name} + {prompt.title || prompt.name} {prompt.description} @@ -143,7 +144,9 @@ const PromptsTab = ({ /> )}

- {selectedPrompt ? selectedPrompt.name : "Select a prompt"} + {selectedPrompt + ? selectedPrompt.title || selectedPrompt.name + : "Select a prompt"}

diff --git a/client/src/components/ResourcesTab.tsx b/client/src/components/ResourcesTab.tsx index 36e5cec8f..e0ef5d0c5 100644 --- a/client/src/components/ResourcesTab.tsx +++ b/client/src/components/ResourcesTab.tsx @@ -135,7 +135,7 @@ const ResourcesTab = ({ )} - {resource.name} + {resource.title || resource.name} @@ -168,7 +168,7 @@ const ResourcesTab = ({ )} - {template.name} + {template.title || template.name} @@ -193,12 +193,17 @@ const ResourcesTab = ({ )}

{selectedResource - ? selectedResource.name + ? selectedResource.title || selectedResource.name : selectedTemplate - ? selectedTemplate.name + ? selectedTemplate.title || selectedTemplate.name : "Select a resource or template"}