# agent402.tools XML Well-Formedness Validator

> agent402.tools XML Well-Formedness Validator is a paid API for AI agents from agent402.tools, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Checks whether an XML string is syntactically well-formed — balanced tags, proper nesting, and properly escaped entities — without performing DTD or schema validation.

## Facts

- Endpoint: POST https://agent402.tools/api/xml-validate
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-tools-xml-well-formedness-validator-42acc81c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Wif_PAePg-MQB6GuApE6r

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 agent402-tools-xml-well-formedness-validator-42acc81c -d '<json body>'
```

Example prompt: Can you check if this XML is well-formed — balanced tags, proper nesting, no unescaped special characters: '<root><item id="1">Hello & world</item></root>'?

## When to prefer this

Use this endpoint when you need a fast, deterministic, pure syntax check of XML well-formedness without any DTD or schema validation overhead. Ideal for pre-processing pipelines that need to confirm XML can be parsed before further processing, or when you want to catch basic structural errors like unclosed tags or bad entity encoding.

## Known failure modes

- Missing or empty 'xml' field returns a validation error
- XML with unescaped ampersands or angle brackets flagged as malformed
- Extremely large XML strings may time out
- Non-UTF-8 encoded content may cause parse errors

## How this service works

Check XML well-formedness: balanced open/close tags, proper nesting, unescaped entities. No DTD/schema validation — syntax only. Pure CPU, deterministic.

## Output

Returns whether the XML string is syntactically well-formed, and if not, provides details about syntax errors such as unbalanced tags, improper nesting, or unescaped entities.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "xml": {
   "type": "string",
   "description": "XML string to validate"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "valid": true,
  "errors": [],
  "rootTag": "root",
  "tagCount": 2
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-tools-xml-well-formedness-validator-42acc81c/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
