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
This commit is contained in:
Olivier Chafik 2026-01-08 17:05:00 +00:00 • committed by GitHub
commit 97990b6b28
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 5 deletions

View file

@ -4047,7 +4047,6 @@
} }
} }
}, },
"required": ["resourceUri"],
"additionalProperties": false "additionalProperties": false
}, },
"McpUiToolResultNotification": { "McpUiToolResultNotification": {

View file

@ -484,12 +484,12 @@ export const McpUiToolVisibilitySchema = z
*/ */
export const McpUiToolMetaSchema = z.object({ 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"]`. * This is converted to `_meta["ui/resourceUri"]`.
* *
* @example "ui://weather/widget.html" * @example "ui://weather/widget.html"
*/ */
resourceUri: z.string(), resourceUri: z.string().optional(),
/** /**
* @description Who can access this tool. Default: ["model", "app"] * @description Who can access this tool. Default: ["model", "app"]
* - "model": Tool visible to and callable by the agent * - "model": Tool visible to and callable by the agent

View file

@ -549,12 +549,12 @@ export type McpUiToolVisibility = "model" | "app";
*/ */
export interface McpUiToolMeta { 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"]`. * This is converted to `_meta["ui/resourceUri"]`.
* *
* @example "ui://weather/widget.html" * @example "ui://weather/widget.html"
*/ */
resourceUri: string; resourceUri?: string;
/** /**
* @description Who can access this tool. Default: ["model", "app"] * @description Who can access this tool. Default: ["model", "app"]
* - "model": Tool visible to and callable by the agent * - "model": Tool visible to and callable by the agent