From 97990b6b2887beccc5750d0ce9ce8f0f62decf7c Mon Sep 17 00:00:00 2001 From: Olivier Chafik Date: Thu, 8 Jan 2026 17:05:00 +0000 Subject: [PATCH] Make ui.resourceUri optional (for tools that just need visibility) (#210) * Make ui.resourceUri optional (for tools that just need visibility) * chore: regenerate schemas for optional resourceUri --- src/generated/schema.json | 1 - src/generated/schema.ts | 4 ++-- src/spec.types.ts | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/generated/schema.json b/src/generated/schema.json index c8a201a..2eedead 100644 --- a/src/generated/schema.json +++ b/src/generated/schema.json @@ -4047,7 +4047,6 @@ } } }, - "required": ["resourceUri"], "additionalProperties": false }, "McpUiToolResultNotification": { diff --git a/src/generated/schema.ts b/src/generated/schema.ts index b9c043b..9acf779 100644 --- a/src/generated/schema.ts +++ b/src/generated/schema.ts @@ -484,12 +484,12 @@ export const McpUiToolVisibilitySchema = z */ export const McpUiToolMetaSchema = z.object({ /** - * URI of the UI resource to display for this tool. + * URI of the UI resource to display for this tool, if any. * This is converted to `_meta["ui/resourceUri"]`. * * @example "ui://weather/widget.html" */ - resourceUri: z.string(), + resourceUri: z.string().optional(), /** * @description Who can access this tool. Default: ["model", "app"] * - "model": Tool visible to and callable by the agent diff --git a/src/spec.types.ts b/src/spec.types.ts index 7e91150..3a93133 100644 --- a/src/spec.types.ts +++ b/src/spec.types.ts @@ -549,12 +549,12 @@ export type McpUiToolVisibility = "model" | "app"; */ export interface McpUiToolMeta { /** - * URI of the UI resource to display for this tool. + * URI of the UI resource to display for this tool, if any. * This is converted to `_meta["ui/resourceUri"]`. * * @example "ui://weather/widget.html" */ - resourceUri: string; + resourceUri?: string; /** * @description Who can access this tool. Default: ["model", "app"] * - "model": Tool visible to and callable by the agent