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