Skip to main content
Glama

Tidy Byte Tools API

XML ↔ JSON

xml_json
Read-onlyIdempotent

Convert XML to JSON, or a JSON object back to XML.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "xml_json"
  }
}

Input Schema

NameRequiredDescriptionDefault
jsonNoA JSON object to turn into XML. Use this instead of text when you already have an object.
rootNoName of the root XML element when converting to XML. Default "root".
textNoThe XML text to convert to JSON, or the JSON text to convert to XML.
compactNoSet to false to keep the full XML tree with attributes listed. Default true, which gives short JSON.
directionNoWhich way to convert: "to-json", "to-xml", or "auto" (the default, which guesses).

Output Schema

NameRequiredDescriptionDefault
okYes
toolYes
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • addedInput schema / properties / compact
      Added value: +{
      +  "description": "Set to false to keep the full XML tree with attributes listed. Default true, which gives short JSON.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / direction / description
      Added value: +"Which way to convert: \"to-json\", \"to-xml\", or \"auto\" (the default, which guesses)."
    • addedInput schema / properties / json
      Added value: +{
      +  "description": "A JSON object to turn into XML. Use this instead of text when you already have an object."
      +}
    • addedInput schema / properties / root
      Added value: +{
      +  "description": "Name of the root XML element when converting to XML. Default \"root\".",
      +  "type": "string"
      +}
    • addedInput schema / properties / text / description
      Added value: +"The XML text to convert to JSON, or the JSON text to convert to XML."
  2. First observed

TDQS

B3.3/5.0
Behavior2/5

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

The annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint=false, so the safety profile is fully covered. The description adds no behavioral context of its own — nothing about attribute handling, malformed-input behavior, or what happens when direction is auto — leaving all nuance to the parameter descriptions.

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, well-formed sentence with the resource pair front-loaded and no filler. It is efficient, though its brevity leaves the direction semantics entirely to the schema.

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?

With 100% schema coverage, rich annotations and an output schema, most of what an agent needs is in structured fields, so the description need not explain return values. The only shortfall is the absence of any mention of auto-detection or sibling disambiguation.

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%, with descriptions for text, json, root, compact and direction that already explain defaults and format hints. The description text contributes no additional parameter meaning beyond the schema, so the baseline of 3 applies.

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 concrete verb (convert) and both resources (XML, JSON), and makes the bidirectional scope explicit. It does not distinguish itself from the sibling yaml_json, which also converts between formats, so an agent must infer which converter applies.

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 is implied by the conversion statement, and the direction parameter in the schema covers the to-json vs to-xml decision. However, the description offers no explicit when-to-use or when-not-to-use guidance, nor any alternative such as yaml_json for YAML inputs.

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.