fix(server): add icons field to registerTool and registerToolTask#1881
Open
sainathreddyb wants to merge 1 commit intomodelcontextprotocol:mainfrom
Open
fix(server): add icons field to registerTool and registerToolTask#1881sainathreddyb wants to merge 1 commit intomodelcontextprotocol:mainfrom
sainathreddyb wants to merge 1 commit intomodelcontextprotocol:mainfrom
Conversation
Add icons support to the registerTool() and registerToolTask() APIs, matching the ToolSchema spec definition which includes IconsSchema.shape. - Add icons?: Icon[] to registerTool() config parameter type - Add icons to _createRegisteredTool() signature and object construction - Add icons to tools/list handler toolDefinition object - Add icons to RegisteredTool type and its update() method - Add icons to all registerToolTask() overload signatures - Add integration tests for icons registration, update, and listing Ref modelcontextprotocol#1864
🦋 Changeset detectedLatest commit: 2d0cb9c The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@modelcontextprotocol/client
@modelcontextprotocol/server
@modelcontextprotocol/express
@modelcontextprotocol/fastify
@modelcontextprotocol/hono
@modelcontextprotocol/node
commit: |
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.
Summary
Add
iconsfield support toregisterTool()andregisterToolTask()APIs, matching theToolSchemaspec definition which includesIconsSchema.shape. Icons are now included intools/listresponses and can be updated viatool.update().Fixes #1864
Motivation and Context
The MCP spec's
ToolSchemaincludesIconsSchema.shape, makingiconsa valid top-level property on tool definitions. However,McpServer.registerTool()did not accepticonsin its config, and thetools/listhandler did not serialize it. This closes the gap between the spec and the SDK.How Has This Been Tested?
tools/listtool.update()→ verify updated icons in listingiconsis undefined in listingBreaking Changes
None. This is a purely additive change —
iconsis optional in all APIs.Types of changes
Checklist
Additional context
This addresses the same issue as #1873 but additionally includes integration tests covering registration, update, and listing behavior for the
iconsfield.