Skip to content

feat: Add titles field #372

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

bzsurbhi
Copy link
Contributor

@bzsurbhi bzsurbhi commented Jul 3, 2025

Add title field to Resource, Tool, Prompt, ClientInfo, and ServerInfo definitions in the spec.

Motivation and Context

By introducing title as a dedicated property, we ensure clarity and consistency in how data is surfaced to end users, improving both developer experience and user-facing usability as the protocol evolves.

How Has This Been Tested?

Added tests

Breaking Changes

None

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

tzolov added a commit that referenced this pull request Jul 9, 2025
- Add BaseMetadata interface with name() and title() methods for consistent metadata handling
- The Prompt, PromptArgument, Resource, ResourceTemplate, ResuorceLink, PromptReference, Tool,
  and Implementation classes implement the BaseMetadata interface, adding a new, optional title field
- Update constructors to support backward compatibility while allowing title specification
- Modify ResourceContent interface to extend BaseMetadata
- Update all test cases to accommodate new title parameter

The title field provides human-readable display names optimized for UI contexts,
while name remains for programmatic/logical use. This change maintains backward compatibility.

Signed-off-by: Christian Tzolov <[email protected]>
Co-authored-by: Christian Tzolov <[email protected]>
Copy link
Contributor

@tzolov tzolov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • please use the tab 4 in instead of spaces.
  • please consider updating the @param javadocs when modifying the record fields
  • only the record filed definitions should be surrounded by // @Formatter:off/on blocks. all other code (e.g constructors, builders ) should be auto-fomrattable.

@tzolov
Copy link
Contributor

tzolov commented Jul 9, 2025

Thank you @bzsurbhi , please check my review comments above for future PRs.

rebased, address the above issues, squashed and merged at 9977a06

@tzolov tzolov closed this Jul 9, 2025
tzolov added a commit that referenced this pull request Jul 11, 2025
…rd types

  As a followup of #372 introduce new constructors to several record types
  in McpSchema (Resource, ResourceTemplate, Prompt, PromptArgument, Tool,
  PromptReference, and ResourceLink) to improve backwards compatibility
  with previous code versions.

Signed-off-by: Christian Tzolov <[email protected]>
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.

2 participants