---
url: >-
  https://adk.nht.io/api/@nhtio/adk/batteries/llm/transformers_js/helpers/functions/createAutoToolCallParser.md
---

# Function: createAutoToolCallParser()

```ts
function createAutoToolCallParser(
  parsers?: Partial<
    Record<Exclude<ToolCallParserName, "auto" | "none">, ToolCallParserFn>
  >,
  order?: readonly (
    | "gemma"
    | "hermes"
    | "gpt_oss"
    | "pythonic"
    | "bare_pythonic"
    | "loose_keyed"
    | "llama3_json"
    | "mistral"
    | "qwen3_coder"
    | "phi"
  )[],
): ToolCallParserFn;
```

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

Compose an `'auto'` parser: run each family parser in `order` until one returns a non-empty
`calls` array; that result wins. Returns no-match if none claim the text.

## Parameters

| Parameter | Type                                                                                                                                                                                                                                                                                                                                                                                                                                                | Default value                    |
| --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- |
| `parsers` | [`Partial`](https://www.typescriptlang.org/docs/handbook/utility-types.html#partialtype)<[`Record`](https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type)<[`Exclude`](https://www.typescriptlang.org/docs/handbook/utility-types.html#excludetype-excludedunion)<[`ToolCallParserName`](../type-aliases/ToolCallParserName.md), `"auto"` | `"none"`>, [`ToolCallParserFn`](../type-aliases/ToolCallParserFn.md)>> | `BUNDLED_TOOL_CALL_PARSERS`      |
| `order`   | readonly ( | `"gemma"` | `"hermes"` | `"gpt_oss"` | `"pythonic"` | `"bare_pythonic"` | `"loose_keyed"` | `"llama3_json"` | `"mistral"` | `"qwen3_coder"` | `"phi"`)\[]                                                                                                                                                                                                                                                                     | `DEFAULT_TOOL_CALL_PARSER_ORDER` |

## Returns

[`ToolCallParserFn`](../type-aliases/ToolCallParserFn.md)
