---
url: >-
  https://adk.nht.io/api/@nhtio/adk/batteries/llm/transformers_js/helpers/variables/gemmaToolCallParser.md
description: >-
  Parse Gemma E2B/E4B tool calls. Accepts the wrapped template form
  (`<|tool_call>call:NAME{k:<|"|>v<|"|>}<tool_call|>`) AND the decoder-stripped
  runtime form (`call:NAME{k:v}`, special tokens removed, scalars unquoted — the
  shape a real ONNX run emits), including NESTED argument blocks with curly
  smart quotes (the form a real E4B `provide_answer` emits:
  `{answer:<|“|>…<|”|>,sources:[{path:…}]}`), AND the PREFIX-LESS bare form
  `NAME{…}` with no `call:` lead (e.g. `say_i_dont_know{reason: "…"}` — a real
  E2B/E4B runtime shape), gated on `ctx.toolNames`. Targets the E2B/E4B form
  only — Gemma 3 (`tool_code` fences) and FunctionGemma
  (`<start_function_call>`) are out of scope (use a custom {@link
  ToolCallParserFn}).
---

# Variable: gemmaToolCallParser

```ts
const gemmaToolCallParser: ToolCallParserFn;
```

Defined in: [src/batteries/llm/chat\_common/tool\_parsers.ts:566](https://github.com/NHTIO/ADK/blob/v1.20260713.1/src/src/batteries/llm/chat_common/tool_parsers.ts#L566)

Parse Gemma E2B/E4B tool calls. Accepts the wrapped template form
(`<|tool_call>call:NAME{k:<|"|>v<|"|>}<tool_call|>`) AND the decoder-stripped runtime form
(`call:NAME{k:v}`, special tokens removed, scalars unquoted — the shape a real ONNX run emits),
including NESTED argument blocks with curly smart quotes (the form a real E4B `provide_answer`
emits: `{answer:<|“|>…<|”|>,sources:[{path:…}]}`), AND the PREFIX-LESS bare form `NAME{…}` with no
`call:` lead (e.g. `say_i_dont_know{reason: "…"}` — a real E2B/E4B runtime shape), gated on
`ctx.toolNames`. Targets the E2B/E4B form only — Gemma 3 (`tool_code` fences) and FunctionGemma
(`<start_function_call>`) are out of scope (use a custom [ToolCallParserFn](../type-aliases/ToolCallParserFn.md)).
