feat(types,spec): add tools field to McpUiHostCapabilities#656
Open
saaage wants to merge 1 commit intomodelcontextprotocol:mainfrom
Open
feat(types,spec): add tools field to McpUiHostCapabilities#656saaage wants to merge 1 commit intomodelcontextprotocol:mainfrom
saaage wants to merge 1 commit intomodelcontextprotocol:mainfrom
Conversation
McpUiAppCapabilities already allows widgets to declare tools: {}
to signal they expose oncalltool/onlisttools, but McpUiHostCapabilities
had no corresponding field. This left the handshake one-sided: widgets
could declare intent but had no way to check whether the host would
honor it, and hosts had no spec-defined way to advertise support.
Add tools?: { listChanged?: boolean } to McpUiHostCapabilities in both
the TypeScript types and the draft spec, with MUST-level requirements on
what a host advertising this capability is expected to implement:
- Call tools/list on the app after connect and surface results to the LLM
- Route matching LLM tool calls back to the app via tools/call
- Re-query tools/list on notifications/tools/list_changed (if listChanged: true)
Fixes: modelcontextprotocol#655
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.
Closes #655.
Problem
McpUiAppCapabilitiesallows widgets to declaretools: {}signalling they exposeoncalltool/onlisttools, butMcpUiHostCapabilitieshas no corresponding field. The handshake is one-sided:tools: {}inui/initialize)getHostCapabilities()?.toolsbecause the field doesn't existbridge.listTools()— the spec gap is likely a contributing factorFix
Add
tools?: { listChanged?: boolean }toMcpUiHostCapabilitiesin bothsrc/spec.types.tsandspecification/draft/apps.mdx, with MUST-level requirements describing what a host advertising this capability is expected to implement:tools/liston the app after connect and surface results to the LLMtools/calltools/listonnotifications/tools/list_changedfrom the app (iflistChanged: true)Precedent
This follows the same pattern as PR #653, which added
updateModelContextandmessagetoMcpUiHostCapabilities— fields that were already in the TypeScript types but missing from the spec document.