Skip to main content
Glama

YAML to JSON API - convert YAML or multi-document .yml to strict JSON

yaml_to_json
Read-onlyIdempotent

Convert YAML text or a base64 .yaml/.yml file into validated RFC 8259 JSON or JSON Lines (.jsonl). Supports multi-document YAML (--- separated Kubernetes/Helm manifests), safe YAML loading with alias-bomb protection, ISO-8601 date serialization, non-string key coercion, pretty (2/4 spaces or tabs) or minified output, and optional key sorting. Deterministic, 0 AI, nothing stored. Free: 5 calls/day per IP. Paid: Radar API key (from €15/mo at https://radarbg.com/pricing#starter via X-API-Key) or $0.001/call via x402 at https://radarbg.com/x402/yaml-to-json.

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "yaml": "service: billing-api\nrelease_date: 2026-11-26\nports:\n  - 8080\n  - 8443\ntls: true"
    },
    "name": "yaml_to_json"
  }
}

Input Schema

NameRequiredDescriptionDefault
yamlNoYAML text to convert (provide yaml, text, or fileContent)
formatNoPretty-printed or single-line minified JSONpretty
indentNoIndentation when format=pretty2
fileNameNoOptional file name, e.g. deployment.yaml
multiDocNoHow to format multi-document YAML (---): JSON array or JSON Linesarray
sortKeysNoSort object keys alphabetically
fileContentNoOptional base64-encoded .yaml / .yml / .txt file (max 5 MB), used instead of yaml

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / yaml / description
      Previous value: -"YAML text to convert (empty = built-in multi-document sample)"New value: +"YAML text to convert (provide yaml, text, or fileContent)"
  2. Added

TDQS

A4.3/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations only cover readOnly/idempotent/openWorld, so return-format and operational details carry real weight here. The description discloses free-tier quota (5 calls/day per IP), two paid auth paths (X-API-Key header vs x402 per-call), statelessness ('nothing stored'), determinism, and safety behavior (alias-bomb protection, ISO-8601 date serialization). That is well beyond what the annotations provide.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single dense paragraph, correctly front-loaded with the conversion verb and resource before capabilities, then pricing. It is efficient, though the pricing URLs and tier detail occupy roughly a third of the text and could be condensed without losing decision-relevant information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, so the description must characterize the return value, and it does: validated RFC 8259 JSON or JSON Lines, with pretty or minified shapes and array-vs-jsonl for multi-doc input. The only shortfall is that the parameter-to-output mapping (what each document becomes in the array or jsonl case) is implied rather than spelled out.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3; the description still adds meaning by tying multiDoc to '---' separated documents and by noting output-shaping behaviors (pretty 2/4 spaces or tabs, minified, optional key sorting) that map to indent/format/sortKeys. It also documents conversion semantics the schema cannot express, such as non-string key coercion and ISO-8601 date handling.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Convert YAML text or a base64 .yaml/.yml file into validated RFC 8259 JSON or JSON Lines') with both input modes and both output modes named. The reverse-direction sibling json_to_yaml is trivially distinguishable from this wording, and the multi-document case is called out explicitly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage context is implied rather than stated: multi-document '--- separated Kubernetes/Helm manifests' signals a scenario, and pricing tiers imply access conditions, but there is no explicit when-to-use versus when-not, and no named alternative. An agent must infer that this is the tool for YAML→JSON and json_to_yaml for the reverse.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources