Task: Add Title Field for Human-Friendly Display Names
Priority: Medium
Breaking Change: No
Description: Objects now have a title field for human-readable display names, while name remains for programmatic use.
Implementation Tasks:
- [ ] Create
BaseMetadatainterface withnameandtitle - [ ] Update
Tool,Resource,Prompt, etc. to inherit fromBaseMetadata - [ ] Implement display name precedence:
title→annotations.title→name - [ ] Update all examples to include
titlefields - [ ] Add helper functions for getting display names
Files to Update:
mcp/types.go- All types that have
namefields - Display logic throughout the codebase
Hi @ezynda3
I came across this issue and wanted to share what I’ve understood so far — let me know if I’m on the right track!
What I Gathered
The idea is to separate programmatic names from user-facing display names by:
- Adding a title field to things like Tool, Resource, Prompt, and ResourceTemplate
- Creating a BaseMetadata interface with GetName(), GetTitle(), and GetDisplayName() methods
- Implementing fallback logic: title → annotations.title → name
This would help with:
- Localization: e.g., name: "create_file" vs title: "Create File"
- Cleaner UIs: display friendly names without changing internal logic
- Backward compatibility: fallback ensures older code still works
Would it be okay if I take this on? I’d love to give it a try and get more familiar with how everything’s wired together. I can start with a PR for the core types first, then follow up with docs and examples.
Let me know if I missed anything or if there’s anything you’d like me to focus on!
Best, david