Home / Servers / Data Formats / xml_to_json

Xml to json

An MCP tool from the Data Formats server, hosted on mcp.hjlabs.in.

Parse XML into JSON: attributes become "@name" keys, text content "#text" (or the value itself for leaf elements), repeated child elements become arrays. Comments, CDATA and declarations are handled.

Name on the gateway: data__xml_to_json · read-only.

Parameters

NameTypeDescription
xml requiredstringThe XML text.
coerce_typesbooleanTurn "12" into 12 and "true" into true. Default false.
include_rootbooleanWrap the result in the root element name. Default true.

How to call it

Through the Smart Gateway, any client can run it by name with call_tool, or let the gateway find it with search_tools:

call_tool arguments
{
  "name": "data__xml_to_json",
  "arguments": {
    "xml": "…"
  }
}

Or connect the Data Formats server directly, which lists 26 tools including this one:

Run in your terminal
claude mcp add --transport http hj-data https://mcp.hjlabs.in/mcp/data \
  --header "Authorization: Bearer YOUR_API_KEY"

Try asking

Use the xml to json tool with xml set to ….

More from Data Formats