Skip to main content
Glama

JSON to YAML API - convert JSON to YAML and YAML to JSON

json_to_yaml
Read-onlyIdempotent

Convert JSON to YAML or YAML to JSON (auto-detected or forced), 2 or 4 space indent, optional keys A to Z. Safe YAML loader (nothing executes); a syntax mistake returns 400 with the line. Runs on our server, files are deleted right after the call, nothing stored. Free: 5 calls/day per IP. Paid: Radar API key (from €9/mo at https://radarbg.com/pricing#starter via X-API-Key) or $0.001/call via x402 at https://radarbg.com/x402/json-to-yaml.

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": {
      "text": "{\"name\": \"Anna\", \"tags\": [\"a\", \"b\"], \"active\": true}",
      "direction": "j2y"
    },
    "name": "json_to_yaml"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYesYour JSON or YAML text
indentNo2 or 4 spaces2
sortKeysNoSort keys A to Z
directionNoauto, j2y (JSON to YAML) or y2j (YAML to JSON)auto

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.9/5.0
Behavior5/5

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

Goes well past the readOnlyHint/idempotentHint/openWorldHint annotations: it discloses that the loader is safe and executes nothing, that a syntax error yields HTTP 400 with the offending line, that files are deleted immediately and nothing is stored, and it documents the auth paths (X-API-Key for the paid tier, x402 per-call) plus the 5-calls/day free limit.

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?

Behavior and conversion scope are front-loaded in the first clauses, followed by safety, error, and licensing facts. It is dense but nearly every clause adds information; the two pricing URLs and currency details are the only mildly promotional padding.

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?

For a stateless converter it covers the essentials an agent needs: direction detection, safety of parsing, error signaling, data retention, and access/pricing. The one notable omission is what the successful response looks like (raw converted text vs. a JSON wrapper), and no output schema is present to fill that gap.

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

Parameters3/5

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

Schema description coverage is 100% and every parameter carries its own description and enum, so the schema does the heavy lifting. The description restates the same facts (auto/j2y/y2j, 2 or 4 spaces, A-to-Z sorting) without adding format subtleties or interactions beyond the schema.

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

Purpose4/5

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

The description names a specific verb and both resource formats: 'Convert JSON to YAML or YAML to JSON'. Format scoping implicitly separates it from generic siblings like data_convert or json_formatter, but no sibling is named or explicitly distinguished, which keeps it short of a 5.

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?

It explains operational options (auto-detected or forced direction, indent choice, key sorting) and states the quota/pricing model, which is useful context for deciding whether a call is viable. However, it never says when to prefer this tool over data_convert, json_formatter, or json_repair_validate, and gives no when-not-to-use guidance.

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