Skip to main content
Glama

IA-QA — 152 QA & Dev Tools for AI Agents

xml_to_json

Read-onlyIdempotent

Convert an XML string to a JSON object. Supports attributes, nested elements, arrays, CDATA, and namespaces. Options: parse numbers, parse booleans, ignore attributes.

Input Schema

NameRequiredDescriptionDefault
inputYesXML string to convert
attr_prefixNoPrefix for attribute keys (default: "@_")
ignore_attrsNoIgnore XML attributes (default: false)
parse_valuesNoAuto-parse numbers and booleans (default: true)

Output Schema

NameRequiredDescriptionDefault
resultNo
key_countNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "input": "<r a=\"1\"><i>x</i><i>y</i></r>"
      +  }
      +]
  2. Changed1 schema field changed
    • addedOutput schema / properties
      Added value: +{
      +  "key_count": {
      +    "type": "number"
      +  },
      +  "result": {}
      +}
  3. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "type": "object"
      +}
  4. 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 readOnly, idempotent, non-destructive and closed-world, so safety is covered. The description adds real behavioral value by listing what the converter handles (attributes, nested elements, arrays, CDATA, namespaces) and the default-on value parsing, which materially changes output shape. It does not say what happens with malformed XML, keeping it at 4.

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?

Three short sentences, front-loaded with the core action, then feature scope, then options. The options clause lightly duplicates schema fields but functions as a useful at-a-glance summary rather than 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?

An output schema exists so return shape needn't be described, and annotations carry the safety profile. The description covers the conversion surface and key option effects; only error handling for invalid XML and the attr_prefix option are unaddressed.

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 the schema already documents all four parameters and their defaults. The description restates the parse/ignore options but omits attr_prefix entirely and adds no syntax or format detail beyond the schema. Baseline 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 first sentence gives a specific verb+resource ("Convert an XML string to a JSON object") that cleanly separates it from format siblings like yaml_to_json and json_to_yaml. The remaining sentences enumerate supported XML features, further pinning down scope. It stops short of naming a sibling explicitly, so 4 rather than 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?

Usage is only implied by the conversion semantics and the option list; there is no statement of when to prefer this over yaml_to_json or json_to_yaml, and no mention of preconditions (well-formed XML). For a self-evident utility that is adequate, but guidance is left to inference.

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.