---
url: >-
  https://adk.nht.io/api/@nhtio/adk/batteries/llm/ollama/exceptions/variables/E_OLLAMA_INVALID_TOOL_CALL_ARGS.md
description: >-
  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).
---

# 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](https://github.com/NHTIO/ADK/blob/v1.20260609.0/src/batteries/llm/ollama/exceptions.ts#L121)

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](../../../../../common/classes/Tokenizable.md), 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'`.
* `rawArgs` — `JSON.stringify(arguments)` of what the model sent, echoed back so it can see it.
