Skip to content

fix(client): prefer title over name in Prompts and Resources lists#1230

Open
MukundaKatta wants to merge 2 commits intomodelcontextprotocol:mainfrom
MukundaKatta:fix/prefer-title-over-name
Open

fix(client): prefer title over name in Prompts and Resources lists#1230
MukundaKatta wants to merge 2 commits intomodelcontextprotocol:mainfrom
MukundaKatta:fix/prefer-title-over-name

Conversation

@MukundaKatta
Copy link
Copy Markdown

Why

The Prompts and Resources tabs display the name field as the user-facing label even when the spec-blessed title field is set. Per the MCP spec, title is the human-friendly display name and should be preferred when present, with name as a programmatic fallback.

Closes #1226 (Prompts)
Closes #1227 (Resources)

What

  • PromptsTab.tsx
    • Add title?: string to the local Prompt type.
    • List label: prompt.title || prompt.name.
    • Selected-prompt header: same.
  • ResourcesTab.tsx
    • Resource list label: resource.title || resource.name.
    • Resource template label: template.title || template.name.
    • Selected-resource header (visible string + title attribute on the wrapping element): same.

Resource and ResourceTemplate types already include title via @modelcontextprotocol/sdk/types.js, so no type changes were needed in ResourcesTab.tsx.

Tested

Manual verification path: load a server that returns prompts/resources with both name and title set; the label and selected-item header now show title. Servers that only set name are unchanged (fallback path).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

List resources shows resource name as label instead of resource title List Prompts uses prompt name instead of prompt title as display label

1 participant