Skip to content
1 min read · 130 words

Variable: E_OLLAMA_INVALID_TOOL_CALL_ARGS

ts
const E_OLLAMA_INVALID_TOOL_CALL_ARGS: CreatedException<[string, string]>;

Defined in: batteries/llm/ollama/exceptions.ts:121

Raised when a tool-call's arguments value emitted by the model is present but is not a JSON object (e.g. an array, null, or a primitive).

Remarks

Non-fatal. Native /api/chat delivers arguments already parsed as an object, so — unlike the OpenAI battery — there is no JSON-parse failure mode; this fires only on the not-an-object case. The adapter does NOT throw it: it instantiates it inside executeAndPersistToolCall, pulls .message into a @nhtio/adk!Tokenizable, and persists a ToolCall record with isError: true so the model can self-correct on the next iteration.

Printf args: [reasonHeadline, rawArgs].

  • reasonHeadline — short reason such as 'must be a JSON object; received array'.
  • rawArgsJSON.stringify(arguments) of what the model sent, echoed back so it can see it.