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
| Name | Type | Description |
|---|---|---|
xml required | string | The XML text. |
coerce_types | boolean | Turn "12" into 12 and "true" into true. Default false. |
include_root | boolean | Wrap 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:
{
"name": "data__xml_to_json",
"arguments": {
"xml": "…"
}
}Or connect the Data Formats server directly, which lists 26 tools including this one:
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 ….