Skip to content

feat(types,spec): add tools field to McpUiHostCapabilities#656

Open
saaage wants to merge 1 commit into
modelcontextprotocol:mainfrom
saaage:feat/host-tools-capability
Open

feat(types,spec): add tools field to McpUiHostCapabilities#656
saaage wants to merge 1 commit into
modelcontextprotocol:mainfrom
saaage:feat/host-tools-capability

Conversation

@saaage

@saaage saaage commented May 6, 2026

Copy link
Copy Markdown

Closes #655.

Problem

McpUiAppCapabilities allows widgets to declare tools: {} signalling they expose oncalltool/onlisttools, but McpUiHostCapabilities has no corresponding field. The handshake is one-sided:

  • Widgets can declare intent (tools: {} in ui/initialize)
  • Hosts have no spec-defined way to advertise they will honor it
  • Widgets cannot gate on getHostCapabilities()?.tools because the field doesn't exist
  • No known host implements bridge.listTools() — the spec gap is likely a contributing factor

Fix

Add tools?: { listChanged?: boolean } to McpUiHostCapabilities in both src/spec.types.ts and specification/draft/apps.mdx, with MUST-level requirements describing what a host advertising this capability is expected to implement:

  1. Call tools/list on the app after connect and surface results to the LLM
  2. Route LLM tool calls matching app-declared tool names back to the app via tools/call
  3. Re-query tools/list on notifications/tools/list_changed from the app (if listChanged: true)

Precedent

This follows the same pattern as PR #653, which added updateModelContext and message to McpUiHostCapabilities — fields that were already in the TypeScript types but missing from the spec document.

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a missing tools capability to McpUiHostCapabilities so hosts can explicitly advertise support for app-declared tools, completing the host↔view capability handshake described in the MCP Apps draft spec.

Changes:

  • Added tools?: { listChanged?: boolean } to McpUiHostCapabilities TypeScript types.
  • Updated the draft spec’s HostCapabilities to document host requirements when advertising tools support.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/spec.types.ts Extends McpUiHostCapabilities with a tools capability for app-declared tools support.
specification/draft/apps.mdx Documents the new tools host capability and associated MUST-level host behaviors in the draft spec.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/spec.types.ts
Comment on lines +511 to +515
/** @description Host supports calling tools declared by the app (oncalltool/onlisttools). When present, the host will call tools/list on the app after connect, surface the results to the LLM, and route matching tool calls back to the app via tools/call. */
tools?: {
/** @description Host supports tools/list_changed notifications from the app and will re-query tools/list when received. */
listChanged?: boolean;
};
Comment on lines +663 to +667
/**
* Host supports calling tools declared by the app (oncalltool/onlisttools).
* When present, the host MUST:
* 1. Call tools/list on the app after connect and surface results to the LLM.
* 2. Route LLM tool calls matching app-declared tool names back to the app via tools/call.
/**
* Host supports calling tools declared by the app (oncalltool/onlisttools).
* When present, the host MUST:
* 1. Call tools/list on the app after connect and surface results to the LLM.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

McpUiHostCapabilities missing tools field — widget-declared tools unimplementable by hosts

3 participants