mcp-go icon indicating copy to clipboard operation
mcp-go copied to clipboard

Task: Add Title Field for Human-Friendly Display Names

Open ezynda3 opened this issue 6 months ago • 1 comments

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 BaseMetadata interface with name and title
  • [ ] Update Tool, Resource, Prompt, etc. to inherit from BaseMetadata
  • [ ] Implement display name precedence: titleannotations.titlename
  • [ ] Update all examples to include title fields
  • [ ] Add helper functions for getting display names

Files to Update:

  • mcp/types.go
  • All types that have name fields
  • Display logic throughout the codebase

ezynda3 avatar Jun 19 '25 08:06 ezynda3

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:

  1. Adding a title field to things like Tool, Resource, Prompt, and ResourceTemplate
  2. Creating a BaseMetadata interface with GetName(), GetTitle(), and GetDisplayName() methods
  3. 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

davidleitw avatar Jun 19 '25 16:06 davidleitw