# generate_invoice

Generate an EN 16931-conformant UBL 2.1 invoice from structured fields. The result is self-validated before being returned. Provide seller, buyer, and at least one line; for standard-rated (category "S") lines include a vatRate and the seller vatId.

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

## Facts

- Tool: `generate_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: 8 (6 required)
- Recommended policy verdict: Rate-limited

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `buyer` | object | yes |  |
| `lines` | array | yes |  |
| `seller` | object | yes |  |
| `dueDate` | string | no |  |
| `payment` | object | no |  |
| `currency` | string | yes | ISO 4217, e.g. EUR. |
| `issueDate` | string | yes | ISO date, e.g. 2026-06-19. |
| `invoiceNumber` | string | yes |  |

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": "generate_invoice",
    "arguments": {
      "buyer": {},
      "lines": [],
      "seller": {},
      "currency": "<currency>",
      "issueDate": "<issueDate>",
      "invoiceNumber": "<invoiceNumber>"
    }
  }
}
```

## Why generate_invoice is rated Medium

An AI agent can call generate_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 generate_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": {
    "generate_invoice": {
      "limits": [
        {
          "counter": "generate_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
- `convert_invoice` — Write — https://policylayer.com/tools/dev-invoicehub-invoicehub/convert-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
