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

UIResourcePart.md

103 lines1.9 KB

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