---
url: >-
  https://adk.nht.io/api/@nhtio/adk/batteries/artifacts/yaml/variables/yamlToJsonTool.md
description: 'Converter tool: YAML → JSON.'
---

# Variable: yamlToJsonTool

```ts
const yamlToJsonTool: Tool<SpooledJsonArtifact<unknown>>;
```

Defined in: [src/batteries/artifacts/yaml/index.ts:505](https://github.com/NHTIO/ADK/blob/v1.20260907.0/src/src/batteries/artifacts/yaml/index.ts#L505)

Converter tool: YAML → JSON.

## Remarks

Takes either inline YAML text or a reference to a [SpooledYamlArtifact](../classes/SpooledYamlArtifact.md) produced
earlier in the turn. Converts to JSON and returns a fresh [SpooledJsonArtifact](../../../../spooled_artifact/classes/SpooledJsonArtifact.md)
immediately queryable with JSON artifact tools.

Non-finite numbers are preserved as their YAML token strings (`.NaN`, `.inf`, `-.inf`).
Undefined values are normalised to the JSON string `'null'`.
