json_to_yaml
Convert a JSON string to YAML format.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | Yes | JSON string to convert. |
Response
| Field | Type | Description |
|---|---|---|
output | string | The 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).
| Code | When | Delivered as |
|---|---|---|
invalid_arguments | input is missing or not a string. | protocol error (invalid_params) |
invalid_json | The input string is not valid JSON. | tool error (isError) |
internal_error | An 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.