-
Notifications
You must be signed in to change notification settings - Fork 965
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
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
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
BaseMetadata
interface with name (required) and title (optional) fieldsResource
,Tool
,Prompt
, andImplementation
types to extend BaseMetadataregisterTool
,registerPrompt
,registerResource
) for consistent API patternsgetDisplayName()
helper function for title fallback logic