Skip to main content
Glama

Convert JSON, YAML, TOML, or XML

convert_data_format
Read-onlyIdempotent

Convert between JSON, YAML, TOML, and XML. Auto-detects the source. Numbers that do not fit in a JavaScript number keep their digits. Errors include a line and column. TOML refuses null and a non-table root.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "text": "<text>"
    },
    "name": "convert_data_format"
  }
}

Input Schema

NameRequiredDescriptionDefault
toNojson
fromNoauto
textYesThe source document.

Output Schema

NameRequiredDescriptionDefault
okYes
lineYes
errorYes
columnYes
outputYes
detectedYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / additionalProperties
      Added value: +false
  2. First observed

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare the read-only, idempotent, closed-world profile, and the description adds real behavior on top: automatic source detection, big-number digit preservation, line/column error reporting, and TOML input restrictions. It stops short of describing output shape, but an output schema exists to cover that.

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

Conciseness5/5

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

Four short sentences, each carrying distinct information: format scope, detection behavior, precision guarantee, error detail, and TOML limits. Nothing is repeated and the core purpose is front-loaded.

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 simple three-parameter converter with an output schema, the description covers detection, precision, error reporting, and input restrictions adequately. The remaining gap is direction/default semantics for the `to` and `from` parameters, which the thin schema descriptions do not fill.

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

Parameters2/5

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

With only 33% schema description coverage, the description is expected to compensate, yet it never names the `from` or `to` parameters. 'Auto-detects the source' hints at the `from: auto` default, but the `to` default of json and the enum meanings are left entirely to 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?

The description opens with a specific verb and the exact set of formats exchanged ('Convert between JSON, YAML, TOML, and XML'), which is enough to distinguish it from format_json (formatting) and convert_csv_json (CSV) without opening a schema.

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

Usage Guidelines2/5

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

It never says when to pick this tool over sibling converters such as format_json or convert_json_to_types, nor when a conversion is inappropriate. The only conditional information is an input constraint ('TOML refuses null and a non-table root'), which is a behavioral rule rather than usage 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.