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 25 free; failed calls free. Reads or computes only and changes nothing; each call is charged, so repeats are not free.

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?

Annotations only declare the safety profile (readOnly, non-destructive, open-world, non-idempotent); the description adds substantial context beyond that: DOCTYPEs and external entities are refused so nothing outside the document is loaded, a hard 100,000-character limit, and per-call billing with the first 25 free and failures not charged. This explains why idempotentHint=false in cost terms and pre-empts the main failure mode (oversized or entity-bearing XML).

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?

Front-loaded with purpose and mapping semantics, then constraints, then pricing; every section is useful. Minor redundancy: 'Reads or computes only and changes nothing' restates readOnlyHint, and the billing point is made twice ('Price $0.01/call...' and 'each call is charged, so repeats are not free').

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?

No output schema exists, so the description carries the burden of explaining return values — and it does, precisely: attributes become '@name' keys, text becomes '#text' or the bare value for text-only elements, and repeated children become arrays. Combined with the size limit and entity refusal, 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?

Schema coverage is 100% and there is a single required parameter, so the schema already documents 'xml'. The description goes beyond it by showing a concrete sample document, which conveys acceptable input shape and the resulting key mapping better than the schema's one-line 'The XML document'.

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?

States a specific verb+resource ('XML to JSON for any XML document') and immediately distinguishes itself from siblings like csv_to_json, yaml_to_json and html_table_to_json by naming the input format. The conversion mapping rules further pin down exactly what the tool produces.

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?

'Use to read XML feeds, SOAP responses and config files in an agent' gives concrete usage contexts, and the 100,000-character cap implicitly tells the agent when it must not use it. It stops short of naming an alternative tool or an explicit when-not condition, so it is clear but not fully 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.