---
url: >-
  https://adk.nht.io/api/@nhtio/adk/batteries/llm/transformers_js/helpers/variables/gptOssToolCallParser.md
description: >-
  Parse gpt-oss Harmony tool calls on the `commentary` channel:
  `<|channel|>commentary to=functions.NAME
  <|constrain|>json<|message|>{…}<|call|>`. The arguments payload after
  `<|message|>` is JSON, located by a string-aware balanced-brace scan so an
  embedded `<|call|>` / brace inside a string value survives. Anchored on the
  literal Harmony markers.
---

# Variable: gptOssToolCallParser

```ts
const gptOssToolCallParser: ToolCallParserFn;
```

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

Parse gpt-oss Harmony tool calls on the `commentary` channel:
`<|channel|>commentary to=functions.NAME <|constrain|>json<|message|>{…}<|call|>`. The arguments
payload after `<|message|>` is JSON, located by a string-aware balanced-brace scan so an embedded
`<|call|>` / brace inside a string value survives. Anchored on the literal Harmony markers.

## Remarks

The Harmony channel/constrain ordering has a documented upstream template-vs-spec drift;
this matches the common ordering. Verify against a real gpt-oss ONNX run when one is available.
