-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Add title to tools, resources, prompts #631
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
Conversation
bhosmer-ant
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a few comments inline, but accepting to unblock
src/server/mcp.ts
Outdated
| delete this._registeredResources[uriOrTemplate] | ||
| if (updates.uri) this._registeredResources[updates.uri] = registeredResource | ||
| } | ||
| if (typeof updates.name !== "undefined") registeredResource.name = updates.name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should there be a title updater here (same for resource() if not factored into something common)?
src/types.ts
Outdated
| /** 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 */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't know if it's worth adding the language about tool.annotations.title from the spec here
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