Skip to content

parseToolArgs

function parseToolArgs(raw): Record<string, unknown>;

Defined in: core/src/tool-args.ts:184

Parse a tool call’s raw argument string into an object, salvaging what a truncated stream left behind, resolving concatenated JSON, and healing double-escaped text either way.

Never throws: a tool call the model malformed is data the caller decides about, not an exception in the transport.

Parameter Type
raw string

Record<string, unknown>