Skip to main content

yaml_to_toml

Convert a YAML string to TOML format.

Parameters​

ParameterTypeRequiredDescription
inputstringYesYAML string to convert. The top-level value must be a mapping; null values and mixed-type sequences are not allowed.

Response​

FieldTypeDescription
outputstringThe converted TOML string.

Example​

{
"input": "name: Alice\nport: 8080\ndb:\n host: localhost\n"
}

Result:

{
"output": "name = \"Alice\"\nport = 8080\n\n[db]\nhost = \"localhost\"\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_yamlThe input string is not valid YAML.tool error (isError)
conversion_failedThe YAML is valid but cannot be represented as TOML (e.g. the top-level value is not a mapping, or it contains null or mixed-type sequences).tool error (isError)
internal_errorAn unexpected server error.protocol error (internal_error)

Notes​

  • TOML does not support null values. Use yaml_to_json if the YAML may contain nulls.
  • Arrays must be homogeneous; mixed-type sequences are not allowed.
  • The top-level YAML value must be a mapping; sequences and scalars at the top level are rejected.