Skip to main content

Type Alias: ToolModelOutput

ToolModelOutput = { type: "text"; value: string; } | { type: "content"; value: MessageContentBlock[]; } | { type: "omit"; }

Defined in: packages/core/src/utils/tools.ts:92

Output transformation result for model context (AI SDK v6 pattern)

Controls how tool output is represented to the model.

Examples

Text representation

toModelOutput: ({ output }) => ({
type: 'text',
value: `Search found ${output.results.length} results`
})

Omit from model context

toModelOutput: ({ output }) => ({
type: 'omit' // Tool ran but output won't be sent to model
})

Rich content blocks

toModelOutput: ({ output }) => ({
type: 'content',
value: [{ type: 'text', text: output.summary }]
})