Skip to main content
Glama

YAML to JSON

yaml_to_json
Read-onlyIdempotent

Convert YAML to JSON while safely rejecting code tags and blocking alias bombs, with multi-document files returned as a JSON array.

Instructions

Convert YAML to JSON (YAML 1.2 core schema plus anchors/aliases, << merge keys, timestamps, multi-document files). Safe: no code tags (!!js/function, !!python… are rejected), alias bombs and recursive aliases are stopped. Several documents become a JSON array. Errors give 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 YAML file (UTF-8; use this for big inputs).
textNoThe YAML 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 object keys alphabetically at every level.
alwaysArrayNoAlways output an array of documents, even for one document.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior3/5

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

The description goes well beyond the annotations, disclosing rejection of code tags, alias-bomb/recursive-alias protection, line-and-column errors, and the 1,000,000-character file fallback. However, it also states the tool will write results to an output file, a side effect that conflicts with readOnlyHint=true. The rich disclosure is offset by that safety-profile mismatch.

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?

Dense but front-loaded: the conversion scope comes first, safety and error behavior second, invocation guidance third. The trailing web-version link is the only sentence that does not help an agent decide or invoke.

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

Completeness5/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 carries the burden of return semantics and does so: multi-document output shape, the file-write alternative, and the error format are all covered. An agent has everything needed to call it correctly and interpret the result.

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 earns a bump by explaining behavior the schema does not, notably that multiple documents become a JSON array (the semantics behind alwaysArray) and that oversized results are written to a file rather than returned. The text/path guidance is largely a restatement of 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?

Opens with a specific verb+resource pair ("Convert YAML to JSON") and immediately scopes the supported feature set (YAML 1.2 core, anchors/aliases, merge keys, timestamps, multi-document). It is unambiguously distinct from the sibling json_to_yaml and from format-only tools like json_format.

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?

It tells the agent how to invoke it ("Give \"text\" or a file \"path\"") and steers large inputs to the path form. What is missing is an explicit when-not or a naming of a preferred alternative, but for a single-purpose converter the context is clear enough.

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