From 8b6b5f1348b26da8c03af3c3d0d445690f017bd2 Mon Sep 17 00:00:00 2001 From: Stefan Age Date: Wed, 6 May 2026 18:46:33 -0500 Subject: [PATCH] feat(types,spec): add tools field to McpUiHostCapabilities 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: #655 --- specification/draft/apps.mdx | 12 ++++++++++++ src/spec.types.ts | 5 +++++ 2 files changed, 17 insertions(+) diff --git a/specification/draft/apps.mdx b/specification/draft/apps.mdx index 6c810d63..502d4224 100644 --- a/specification/draft/apps.mdx +++ b/specification/draft/apps.mdx @@ -660,6 +660,18 @@ interface HostCapabilities { /** Host supports resources/list_changed notifications. */ listChanged?: boolean; }; + /** + * 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. + * 3. If listChanged is true: re-query tools/list when it receives a + * notifications/tools/list_changed notification from the app. + */ + tools?: { + /** Host will re-query tools/list when it receives notifications/tools/list_changed from the app. */ + listChanged?: boolean; + }; /** Host accepts log messages. */ logging?: {}; /** Sandbox configuration applied by the host. */ diff --git a/src/spec.types.ts b/src/spec.types.ts index 9f83fa97..1c275d9b 100644 --- a/src/spec.types.ts +++ b/src/spec.types.ts @@ -508,6 +508,11 @@ export interface McpUiHostCapabilities { /** @description Host supports resources/list_changed notifications. */ listChanged?: boolean; }; + /** @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; + }; /** @description Host accepts log messages. */ logging?: {}; /** @description Sandbox configuration applied by the host. */