Add title to tools, resources, prompts#631
Merged
Merged
Conversation
bhosmer-ant
approved these changes
Jun 16, 2025
Contributor
bhosmer-ant
left a comment
There was a problem hiding this comment.
Left a few comments inline, but accepting to unblock
| delete this._registeredResources[uriOrTemplate] | ||
| if (updates.uri) this._registeredResources[updates.uri] = registeredResource | ||
| } | ||
| if (typeof updates.name !== "undefined") registeredResource.name = updates.name |
Contributor
There was a problem hiding this comment.
Should there be a title updater here (same for resource() if not factored into something common)?
| /** Intended for programmatic or logical use, but used as a display name in past specs or fallback */ | ||
| name: z.string(), | ||
| version: z.string(), | ||
| /** Intended for UI and end-user contexts — optimized to be human-readable */ |
Contributor
There was a problem hiding this comment.
Don't know if it's worth adding the language about tool.annotations.title from the spec here
bhosmer-ant
reviewed
Jun 16, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background: https://github.com/modelcontextprotocol/modelcontextprotocol/pull/663/files
Closes: #624
Changes
BaseMetadatainterface with name (required) and title (optional) fieldsResource,Tool,Prompt, andImplementationtypes to extend BaseMetadataregisterTool,registerPrompt,registerResource) for consistent API patternsgetDisplayName()helper function for title fallback logic