Open History to see the last commit
1---
2id: normalizeToolResult
3title: normalizeToolResult
4---
5
6```ts
7function normalizeToolResult(result): string | ContentPart[];
8```
9
10Defined in: [packages/ai/src/utilities/tool-result.ts:90](https://github.com/TanStack/ai/blob/main/packages/ai/src/utilities/tool-result.ts#L90)
11
12Normalize a tool's return value for transport:
13- string → unchanged
14- ContentPart array → unchanged (multimodal, passed through to the adapter)
15- anything else → `JSON.stringify`
16
17## Parameters
18
19### result
20
21`unknown`
22
23## Returns
24
25`string` \| [`ContentPart`](../type-aliases/ContentPart.md)[]