Skip to main content
Glama

JSON to YAML

json_to_yaml
Read-onlyIdempotent

Convert JSON text or files into YAML with selectable 2- or 4-space indentation, optional key sorting, multi-document output, and precise error reporting.

Instructions

Convert JSON to YAML (js-yaml dump: no line wrapping, no anchors; strings that would read as numbers/booleans are quoted). Options: 2 or 4 space indent, sort keys, and write a top-level array as a multi-document YAML stream (--- per item). Invalid JSON gives line and column. Give "text" or a file "path". Web version: https://s3eidat.github.io/yaml-json/

Input Schema

NameRequiredDescriptionDefault
pathNoOr: a path to a JSON file (UTF-8; use this for big inputs).
textNoThe JSON as inline text.
indentNoIndentation: 2 or 4 spaces.
outputNoOptional: also write the result to this file path (or folder ending in "/"). The result text is then left out of the reply. Results over 1,000,000 characters are always written to a file.
sortKeysNoSort mapping keys alphabetically.
multiDocumentNoA top-level JSON array becomes one YAML document per item.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations declare readOnlyHint and idempotentHint, so the safety profile is already covered; the description adds real behavioral detail beyond that: error reporting ('Invalid JSON gives line and column'), the no-anchors/no-wrap dump behavior, and the multi-document stream output. It does not mention the 1,000,000-character auto-file-write rule, but that lives in the schema, so the gap is minor.

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?

Front-loads the conversion behavior, then options, then error handling and input modes — a sensible priority order in a compact block. The parenthetical style and trailing marketing URL cost it the top score, but almost every clause carries 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?

For a straightforward converter with no output schema, the description covers output format quirks, options, error behavior, and input source. It leaves the file-output threshold to the schema, which is acceptable, so nothing critical is missing for correct invocation.

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 coverage is 100%, so all six parameters are already documented, and the description largely restates them (indent 2/4, sort keys, multi-document). The 'path or text' input-mode hint adds a little framing value but no syntax or edge-case detail beyond the schema.

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 JSON to YAML) and immediately qualifies the exact serializer semantics (js-yaml dump, no line wrapping, no anchors, quoting of ambiguous strings). An agent can distinguish it from siblings like yaml_to_json or json_format at a glance.

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

Usage Guidelines4/5

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

Explicitly tells the agent how to supply input: 'Give "text" or a file "path"' (path recommended implicitly for large inputs via the schema). It doesn't name an alternative tool or exclusion condition, but the inverse relationship with yaml_to_json is self-evident from the name.

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

Deploy Server

Other Tools