XML to JSON
Convert XML to JSON and pretty-print it - the 'legacy API response to modern format' workflow in one call.
$0.050
per call · one payment for the whole workflow
POST /api/skill/xml-json
3 tools run server-side in one request. You pay once, settle once, and get a single response - no orchestration, no per-step payments, and a partial-success envelope if any step fails. USDC over x402 on any supported chain.
When to use this pack
An agent received XML (from a SOAP service, RSS feed, or legacy API) and needs clean formatted JSON. The chain converts then pretty-prints for readability.
Tools in this pack
All 3 run inside the single $0.050 call above. Each is also callable on its own if you only need one part.
- XML to JSON POST /api/xml-to-json Parse XML into a JSON object tree (attributes under _attrs, text under _text; repeated elements become arrays).
- JSON validate & format POST /api/json-format Validate, pretty-print, or minify JSON. Returns parse errors with position when invalid.
- JSON Schema validate POST /api/json-validate Validate a JSON document against a JSON Schema (draft-07 subset) and get the list of violations. Supports type, required, properties, items, enum, const, min/max, length, pattern, format, anyOf/allOf/oneOf/not, additionalProperties. Deterministic - check an agent's structured output before you trust it.
Workflow
- Convert XML to JSON with xml-to-json - parses the XML structure into a JSON object.
- Pretty-print the result with json-format - indented, readable JSON for inspection or downstream use.
- Validate the converted JSON with json-validate - confirms the XML parsed into well-formed JSON (no truncation, no dangling structure) before you hand it to a downstream consumer that would choke on malformed input.
Call it directly
Any x402 client pays the 402 and gets the whole workflow back in one response:
npx agent402-client call xml-json {"xml":"<root><item>hello</item></root>"}
Run it in Claude
claude mcp add agent402 -s user -- npx -y agent402-mcp@latest
Then paste this prompt into Claude:
Convert XML to JSON using Agent402: (1) xml-to-json {xml:"<root><item>hello</item></root>"} - parse. (2) json-format on the result - pretty-print. (3) json-validate on the result - confirm well-formed. Return the formatted, validated JSON.