# validate_invoice

Validate a UBL 2.1 invoice (or credit note) XML string against the official EN 16931 Schematron. Returns whether it is valid and any failing BR-* business rules.

Agent View of the PolicyLayer registry record for `validate_invoice`. HTML page: https://policylayer.com/tools/dev-invoicehub-invoicehub/validate-invoice

## Facts

- Tool: `validate_invoice`
- Server: Invoicehub (`https://api.invoicehub.dev/mcp`) — https://policylayer.com/tools/dev-invoicehub-invoicehub.md
- Homepage: https://github.com/einvoice-dev1/einvoice
- Risk category: Read (Low risk)
- Registry record: grade C, identity unverified
- Server auth posture: open
- Server rate-limited: no
- Parameters: 1 (1 required)
- Recommended policy verdict: Allowed

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `xml` | string | yes | Raw UBL 2.1 invoice XML. |

Parameters from the server's own tool schema.

## Example call (MCP tools/call, JSON-RPC 2.0)

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "validate_invoice",
    "arguments": {
      "xml": "<xml>"
    }
  }
}
```

## Why validate_invoice is rated Low

Even though validate_invoice only reads data, uncontrolled read access leaks sensitive information and racks up API costs: an agent caught in a retry loop can make thousands of calls a minute without anyone noticing.

## Use case

AI agents call validate_invoice to retrieve information from Invoicehub without modifying anything. It is typically the context-gathering step in research, monitoring, and reporting workflows, before the agent takes action elsewhere.

## Recommended policy (PolicyLayer)

Verdict: **Allowed**. Enforced by the PolicyLayer MCP gateway (https://policylayer.com/mcp-gateway) before a call reaches Invoicehub:

```json
{
  "version": "1",
  "default": "deny",
  "tools": {
    "validate_invoice": {}
  }
}
```

## Other tools on Invoicehub (3)

- `list_supported_formats` — Read — https://policylayer.com/tools/dev-invoicehub-invoicehub/list-supported-formats.md
- `convert_invoice` — Write — https://policylayer.com/tools/dev-invoicehub-invoicehub/convert-invoice.md
- `generate_invoice` — Write — https://policylayer.com/tools/dev-invoicehub-invoicehub/generate-invoice.md

## For agents

This record is a snapshot. Live verdicts and the full registry:

- Check every server in your MCP config at once: `npx -y policylayer stack`
- Vet a server before you add it: install the mcp-precheck skill — `npx skills add https://policylayer.com` (skill text: https://policylayer.com/skill.md)
- Query the registry over MCP: endpoint `https://api.policylayer.com/mcp` — tools `check_mcp_server`, `check_mcp_stack`, `check_tool`, `search_registry`, `get_change_events`

---

Source: the PolicyLayer MCP registry — one continuously verified record per MCP server. Full record: https://policylayer.com/registry?q=dev-invoicehub-invoicehub · API: https://policylayer.com/registry/api · Policy library: https://policylayer.com/policies/dev-invoicehub-invoicehub
