Expand description
Parse and validate provider tool calls at the Core boundary.
Rust port of the AI SDK’s parse-tool-call.ts
(packages/ai/src/generate-text/parse-tool-call.ts). Providers deliver the
model’s raw argument text; Core owns JSON parsing, prototype-pollution
rejection, schema validation, and the one-shot repair callback.
Structs§
- RawTool
Call - Provider-facing tool call before Core parses and validates its input.
- Tool
Call Repair - Async callback that may replace one invalid tool call.
- Tool
Call Repair Context - Context supplied to a one-shot tool-call repair callback.
Enums§
- Tool
Call Repair Reply - A host’s answer to one tool-call repair request.
Functions§
- apply_
tool_ call_ repair - Resolve one invalid tool call against a host’s repair reply.
- apply_
tool_ call_ repair_ to_ result - Apply a repair reply to a serialized
GenerateTextResultorGenerateObjectResult, orStreamTextResultAggregated, returning the patched result. - parse_
tool_ call - Parse and validate a provider tool call using the AI SDK operation contract.
- tool_
call_ repair_ context - Build the repair argument a host needs, as JSON, or
Nonewhen the call was made without a tool set. - tool_
call_ repair_ inputs - Recover the three repair inputs from the same
promptandoptionsa caller already passed togenerate_text/stream_text.