---
name: counterfoil
description: Read a stored EU e-invoice business rule, read a UBL slice, or read the invoice field map. Use when a task names a Peppol, XRechnung, or EN 16931 rule id, a BT code, a validator message, a UBL invoice, or the invoice field map. Call POST /mcp on https://einvoicegoblin.com. Not a validator and not tax advice.
---

# Counterfoil

Registry 0.45.0. Canonical origin https://einvoicegoblin.com.

## Tools

POST https://einvoicegoblin.com/mcp with one JSON-RPC message. No session. The body is not stored.

Protocol 2026-07-28: send `MCP-Protocol-Version: 2026-07-28`, `Mcp-Method`, and `Mcp-Name` on tools/call. Put the same version in `params._meta` under `io.modelcontextprotocol/protocolVersion`. `server/discover` lists the supported versions.

Legacy initialize also works for 2025-11-25, 2025-06-18, and 2025-03-26.

Tools: get_rule, search_rules, explain_error, and check_invoice. The first three return the stored statement, the plain reading, the fix, and the source URL. check_invoice takes a UBL Invoice XML string of at most 60000 characters and returns the terms that slice writes, the field-map gaps, and one stored BR-DE-15 note when buyer reference BT-10 is absent. evaluation stays false. The result does not say the invoice passed.

The same reading is POST https://einvoicegoblin.com/v1/invoices/check. Send the raw UBL bytes, or a JSON object with one string field named xml. The limit is 1048576 bytes. The body is not stored.

## Reads

1. GET https://einvoicegoblin.com/rules/index.json — the stored UBL rules.
2. GET https://einvoicegoblin.com/rules/{id}.json — one rule. Take the id from the index. BR-IC-05 is stored. An unknown id is HTTP 404 with an empty body.
3. GET https://einvoicegoblin.com/bt-map.json — which invoice-form boxes match one EN 16931 term. The form does not assign a VAT category code.

The server card at https://einvoicegoblin.com/.well-known/mcp/server-card.json lists those tools. OpenAPI for the three GETs, POST /mcp, and POST /v1/invoices/check is https://einvoicegoblin.com/openapi.json.

## Limits

check_invoice reads a UBL slice. These notes do not emit UBL. evaluation stays false. Not tax, legal, or accounting advice.
