# XML to JSON Converter (toolshed.lemon-agent.dev)

> XML to JSON Converter (toolshed.lemon-agent.dev) is a paid API for AI agents from toolshed.lemon-agent.dev, paid per call via x402, $0.006/call, status unknown (last checked 2026-10-30).

Converts a raw XML document into JSON using fast-xml-parser conventions, with attributes prefixed @_, text content under #text, and repeated elements collapsed into arrays.

## Facts

- Endpoint: POST https://toolshed.lemon-agent.dev/convert/xml-json?utm_source=zero.xyz
- Price: $0.006/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-30
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/xml-to-json-converter-toolshed-lemon-agent-dev-0a382bb7
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_663xGFH3l5WXFCxVoxLwp

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability xml-to-json-converter-toolshed-lemon-agent-dev-0a382bb7 -d '<json body>'
```

Example prompt: Convert this XML document to JSON for me — it's an RSS feed about 30 KB large, and I need the output in fast-xml-parser format with attributes as @_ keys and repeated elements collapsed into arrays.

## When to prefer this

Use this endpoint when you need a lightweight, predictable XML-to-JSON conversion following fast-xml-parser conventions without type guessing. It is ideal for processing SOAP responses, RSS/Atom feeds, XML config files, or any well-formed XML up to 256 KB. Avoid it if your document contains a DOCTYPE declaration, if you need type coercion (e.g. numbers parsed as integers), or if you need a different JSON mapping convention.

## Known failure modes

- Document contains <!DOCTYPE> declaration — refused to prevent XML entity expansion attacks
- Payload exceeds 256 KB limit — request rejected
- Malformed or non-parseable XML — parsing error returned
- Empty body — missing required input field error
- Content-type mismatch or encoding issues causing parse failure

## How this service works

XML to JSON. POST an XML document; the response is JSON in fast-xml-parser's convention — attributes prefixed @_, text content under #text, and repeated sibling elements collapsed into an array (so an element appearing once is an object and twice is an array). Values stay strings; no type guessing. A document carrying a <!DOCTYPE> is refused, because internal entities are an expansion attack.

## Output

A JSON object produced by fast-xml-parser conventions: XML attributes are prefixed with @_, text node content appears under #text, and sibling elements that repeat are collapsed into an array (single occurrence = object, multiple = array). All values remain strings with no type coercion. DOCTYPE-bearing documents are rejected to prevent entity expansion attacks.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "string",
     "maxLength": 262144,
     "description": "the raw XML file as the request body, up to 256 KB"
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "type": "string",
     "const": "POST"
    },
    "bodyType": {
     "type": "string",
     "const": "text"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type",
    "format"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "text"
    },
    "format": {
     "type": "string",
     "const": "application/json",
     "description": "the converted JSON file as the response body (application/json)"
    },
    "example": {
     "type": "string",
     "description": "the sample request body above, converted — what a the converted JSON file as the response body (application/json) looks like"
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/xml-to-json-converter-toolshed-lemon-agent-dev-0a382bb7/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from toolshed.lemon-agent.dev](https://www.zero.xyz/host/toolshed.lemon-agent.dev/llms.txt)
