Skip to main content

json_to_yaml

Convert a JSON string to YAML format.

Parameters​

ParameterTypeRequiredDescription
inputstringYesJSON string to convert.

Response​

FieldTypeDescription
outputstringThe converted YAML string.

Example​

{
"input": "{\"name\": \"Alice\", \"age\": 30, \"active\": true}"
}

Result:

{
"output": "name: Alice\nage: 30\nactive: true\n"
}

Errors​

Each failure carries a precise code in the response. Argument-schema and server errors are JSON-RPC protocol errors; a rejected value is returned as a tool result with isError: true (so the agent can read the code and self-correct).

CodeWhenDelivered as
invalid_argumentsinput is missing or not a string.protocol error (invalid_params)
invalid_jsonThe input string is not valid JSON.tool error (isError)
internal_errorAn unexpected server error.protocol error (internal_error)

Notes​

  • All standard JSON types (objects, arrays, strings, numbers, booleans, null) are supported.
  • The output uses 2-space YAML indentation.