Skip to content
Source
Sign inSign up
TanStack/ai
Open History to see the last commit

UIResourcePart.md

105 lines1.9 KB

1---
2id: UIResourcePart
3title: UIResourcePart
4---
5​
6# Interface: UIResourcePart
7​
8Defined in: [packages/ai/src/types.ts:451](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L451)
9​
10## Properties
11​
12### meta?
13​
14```ts
15optional meta: Record<string, unknown>;
16```
17​
18Defined in: [packages/ai/src/types.ts:465](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L465)
19​
20Reserved for future passthrough of the resource/tool `_meta.ui` (e.g. frame-size hints).
21 Currently always `undefined` — nothing populates this field yet.
22​
23***
24​
25### resource
26​
27```ts
28resource: object;
29```
30​
31Defined in: [packages/ai/src/types.ts:454](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L454)
32​
33The ui:// resource object in MCP-native shape — fed straight to the renderer.
34​
35#### blob?
36​
37```ts
38optional blob: string;
39```
40​
41#### mimeType
42​
43```ts
44mimeType: string;
45```
46​
47#### text?
48​
49```ts
50optional text: string;
51```
52​
53#### uri
54​
55```ts
56uri: string;
57```
58​
59***
60​
61### serverId?
62​
63```ts
64optional serverId: string;
65```
66​
67Defined in: [packages/ai/src/types.ts:456](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L456)
68​
69Pool prefix / config key — routes interactive calls to the right MCP server.
70​
71***
72​
73### toolCallId
74​
75```ts
76toolCallId: string;
77```
78​
79Defined in: [packages/ai/src/types.ts:459](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L459)
80​
81Links the widget to the originating tool call — correlates it with the
82 sibling ToolCallPart/ToolResultPart in the same message.
83​
84***
85​
86### toolName
87​
88```ts
89toolName: string;
90```
91​
92Defined in: [packages/ai/src/types.ts:462](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L462)
93​
94Server-native (unprefixed) MCP tool name whose UI this resource renders.
95 Required by the renderer (`@mcp-ui/client`'s `AppRenderer` `toolName` prop).
96​
97***
98​
99### type
100​
101```ts
102type: "ui-resource";
103```
104​
105Defined in: [packages/ai/src/types.ts:452](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L452)