# convert_invoice

Convert an e-invoice between formats via the shared EN 16931 canonical model: parse the source document, re-serialize as the target, and validate the result before returning it — never a document that has not been checked. Format ids: "UBL_2.1" (OASIS UBL, the universal Peppol/EN16931 baseline), "UN_CEFACT_CII" (UN/CEFACT Cross Industry Invoice, required syntax for Chorus Pro/France and many ERP back-ends), "XRechnung_UBL" / "XRechnung_CII" (Germany's mandatory B2G format, XRechnung 3.0 — required for invoicing German public-sector buyers), "Factur-X" (France/Germany hybrid PDF+XML — a human-readable PDF/A-3 with the structured invoice embedded, common for French B2B). Binary formats (Factur-X) are base64 in both directions. Requires an API key on the Pro plan or above for any target beyond plain UBL_2.1 — call list_supported_formats to see current availability.

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

## Facts

- Tool: `convert_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: Write (Medium risk)
- Registry record: grade C, identity unverified
- Server auth posture: open
- Server rate-limited: no
- Parameters: 3 (3 required)
- Recommended policy verdict: Rate-limited

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `to` | string | yes | Target format id, e.g. "UN_CEFACT_CII", "XRechnung_UBL", "XRechnung_CII", or "Factur-X". |
| `from` | string | yes | Source format id, e.g. "UBL_2.1". |
| `document` | string | yes | The source document: raw text for XML formats, base64 for binary formats (Factur-X). |

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": "convert_invoice",
    "arguments": {
      "to": "<to>",
      "from": "<from>",
      "document": "<document>"
    }
  }
}
```

## Why convert_invoice is rated Medium

An AI agent can call convert_invoice faster than any human can review: one bad instruction and it creates or modifies resources in Invoicehub by the hundred, each call as confident as the last.

## Use case

AI agents use convert_invoice to create or update resources in Invoicehub, usually the action step of a workflow, after the agent has gathered context. Every call changes real data in your Invoicehub environment.

## Recommended policy (PolicyLayer)

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

```json
{
  "version": "1",
  "default": "deny",
  "tools": {
    "convert_invoice": {
      "limits": [
        {
          "counter": "convert_invoice_rate",
          "window": "minute",
          "max": 30,
          "scope": "grant"
        }
      ]
    }
  }
}
```

## Other tools on Invoicehub (3)

- `list_supported_formats` — Read — https://policylayer.com/tools/dev-invoicehub-invoicehub/list-supported-formats.md
- `validate_invoice` — Read — https://policylayer.com/tools/dev-invoicehub-invoicehub/validate-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
