Skip to content

Commit 411787d

Browse files
antonpk1claude
andcommitted
address PR review comments
- Change default visibility to ["model", "apps"] - Add deprecation notice for flat ui/resourceUri format - Add McpUiToolMeta and McpUiToolVisibility to spec.types.ts - Improve tools/list and tools/call behavior wording 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent e20929e commit 411787d

File tree

2 files changed

+33
-10
lines changed

2 files changed

+33
-10
lines changed

specification/draft/apps.mdx

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -252,11 +252,11 @@ interface McpUiToolMeta {
252252
/** URI of UI resource for rendering tool results */
253253
resourceUri?: string;
254254
/**
255-
* Who can access this tool. Default: ["model"]
255+
* Who can access this tool. Default: ["model", "app"]
256256
* - "model": Tool visible to and callable by the agent
257-
* - "apps": Tool callable by ui apps from this server
257+
* - "app": Tool callable by the app from this server only
258258
*/
259-
visibility?: Array<"model" | "apps">;
259+
visibility?: Array<"model" | "app">;
260260
}
261261

262262
interface Tool {
@@ -265,10 +265,14 @@ interface Tool {
265265
inputSchema: object;
266266
_meta?: {
267267
ui?: McpUiToolMeta;
268+
/** @deprecated Use `ui.resourceUri` instead. Will be removed before GA. */
269+
"ui/resourceUri"?: string;
268270
};
269271
}
270272
```
271273

274+
> **Deprecation notice:** The flat `_meta["ui/resourceUri"]` format is deprecated. Use `_meta.ui.resourceUri` instead. The deprecated format will be removed before GA.
275+
272276
Example (tool visible to both model and apps):
273277

274278
```json
@@ -284,7 +288,7 @@ Example (tool visible to both model and apps):
284288
"_meta": {
285289
"ui": {
286290
"resourceUri": "ui://weather-server/dashboard-template",
287-
"visibility": ["model", "apps"]
291+
"visibility": ["model", "app"]
288292
}
289293
}
290294
}
@@ -300,7 +304,7 @@ Example (app-only tool, hidden from model):
300304
"_meta": {
301305
"ui": {
302306
"resourceUri": "ui://weather-server/dashboard-template",
303-
"visibility": ["apps"]
307+
"visibility": ["app"]
304308
}
305309
}
306310
}
@@ -317,11 +321,11 @@ Example (app-only tool, hidden from model):
317321

318322
#### Visibility:
319323

320-
- `visibility` defaults to `["model"]` if omitted (standard MCP behavior)
324+
- `visibility` defaults to `["model", "app"]` if omitted
321325
- `"model"`: Tool is visible to and callable by the agent
322-
- `"apps"`: Tool is callable by apps from the same server connection only
323-
- Host MUST NOT include tools with `visibility: ["apps"]` in the agent's tool list
324-
- Host MUST reject `tools/call` requests from apps for tools that don't include `"apps"` in visibility
326+
- `"app"`: Tool is callable by the app from the same server connection only
327+
- **tools/list behavior:** Host MUST NOT include tools in the agent's tool list when their visibility does not include `"model"` (e.g., `visibility: ["app"]`)
328+
- **tools/call behavior:** Host MUST reject `tools/call` requests from apps for tools that don't include `"app"` in visibility
325329
- Cross-server tool calls are always blocked for app-only tools
326330

327331
#### Benefits:
@@ -1084,7 +1088,7 @@ await client.callTool("get_weather", { location: "New York" });
10841088

10851089
This pattern enables interactive, self-updating widgets.
10861090

1087-
Note: Tools with `visibility: ["apps"]` are hidden from the agent but remain callable by apps via `tools/call`. This enables UI-only interactions (refresh buttons, form submissions) without exposing implementation details to the model. See the Visibility section under Resource Discovery for details.
1091+
Note: Tools with `visibility: ["app"]` are hidden from the agent but remain callable by apps via `tools/call`. This enables UI-only interactions (refresh buttons, form submissions) without exposing implementation details to the model. See the Visibility section under Resource Discovery for details.
10881092

10891093
### Client\<\>Server Capability Negotiation
10901094

src/spec.types.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,3 +485,22 @@ export interface McpUiResourceMeta {
485485
/** @description Visual boundary preference - true if UI prefers a visible border. */
486486
prefersBorder?: boolean;
487487
}
488+
489+
/**
490+
* @description Tool visibility scope - who can access the tool.
491+
*/
492+
export type McpUiToolVisibility = "model" | "apps";
493+
494+
/**
495+
* @description UI-related metadata for tools.
496+
*/
497+
export interface McpUiToolMeta {
498+
/** @description URI of UI resource for rendering tool results. */
499+
resourceUri?: string;
500+
/**
501+
* @description Who can access this tool. Default: ["model", "apps"]
502+
* - "model": Tool visible to and callable by the agent
503+
* - "apps": Tool callable by apps from this server only
504+
*/
505+
visibility?: McpUiToolVisibility[];
506+
}

0 commit comments

Comments
 (0)