Skip to main content
Glama

Agent Data Tools: Utilities

XML to JSON converter: convert an XML document into JSON

xml_to_json
Read-only

XML to JSON for any XML document: attributes become "@name" keys, text becomes "#text" (or the value itself when an element only holds text), and repeated child elements become arrays. DOCTYPEs and external entities are refused, so nothing outside the document is ever loaded. Up to 100,000 characters. Use to read XML feeds, SOAP responses and config files in an agent. Example: xml=PenInk. Price $0.01/call via x402 USDC or a card key (/credits), first 10 free; failed calls free. Reads or computes only and changes nothing; each call is charged, so repeats are not free.

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": {
      "xml": "<xml>"
    },
    "name": "xml_to_json"
  }
}

Input Schema

NameRequiredDescriptionDefault
xmlYesThe XML document

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the annotations, it discloses that DOCTYPEs and external entities are refused so nothing outside the document is loaded, a 100,000-character input ceiling, and the billing model with failed calls free. It also explains that each call is charged so repeats are not free, which gives the agent the practical consequence behind idempotentHint=false.

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?

It is front-loaded with the conversion semantics and security behavior, then moves to limits, an example, and pricing — a logical order. The pricing and 'repeats are not free' wording is slightly verbose but still earns its place as operational information.

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, yet the description effectively documents the return structure through the key-mapping rules and the inline example. Combined with the size limit and entity-refusal behavior, an agent has everything needed to call it correctly.

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?

Only one parameter exists and the schema already covers it at 100%, so the baseline is high. The description adds value with a worked example showing the expected XML shape and a size constraint on the input, which the schema does not state.

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 states a specific verb and resource (convert an XML document into JSON) and goes further by specifying the exact output mapping rules: attributes become '@name' keys, text becomes '#text' or the bare value, repeated children become arrays. That detail lets an agent distinguish this from siblings like csv_to_json or html_to_json 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 Guidelines4/5

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

It gives concrete usage context — 'Use to read XML feeds, SOAP responses and config files in an agent' — which tells the agent the input domain it is meant for. It does not explicitly name an alternative or an exclusion (e.g., what to use for HTML tables), so it stops short of full when/when-not routing.

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.

Resources