---
url: >-
  https://adk.nht.io/api/@nhtio/adk/batteries/llm/transformers_js/helpers/variables/phiToolCallParser.md
description: >-
  Parse Phi-4-mini tool calls: the literal `functools` token followed by a JSON
  array of `{ name, arguments }` objects (e.g.
  `functools[{"name":"get_weather","arguments":{"city":"SF"}}]`).
---

# Variable: phiToolCallParser

```ts
const phiToolCallParser: ToolCallParserFn;
```

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

Parse Phi-4-mini tool calls: the literal `functools` token followed by a JSON array of
`{ name, arguments }` objects (e.g. `functools[{"name":"get_weather","arguments":{"city":"SF"}}]`).

## Remarks

Anchored on the `functools` begin-of-tool token (vLLM's `phi4_mini_json`). The array is located by
scanning for the first `[` after the token and matching to its balanced closing `]`, so trailing
prose after the call does not break parsing. Declines (no-match) if the payload is not a JSON array
of name-bearing objects.
