JSON and YAML converter
json_yaml_convertConvert text between JSON and YAML with safe parsing, indent, key sorting and minify options, and line-accurate error messages. Cost: 1 credit per call. Output: a file (application/json | application/yaml) returned inline, at most 1 MiB. converted.json or converted.yaml; meta: {from, to}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | Target format. Default: yaml for JSON input, json for YAML input. | |
| from | No | Source format; auto tries JSON first, then YAML. | auto |
| input | Yes | The JSON or YAML text to convert (up to 2 MB). | |
| indent | No | Spaces per level. JSON: 0 puts items on their own lines without indentation. YAML: values below 2 are treated as 2. | |
| minify | No | JSON: single line without spaces. YAML: single-line flow style. Overrides indent. | |
| sort_keys | No | Sort object keys alphabetically (default: keep input order). |