{"openapi": "3.1.0", "info": {"title": "NBrain GCC E-Invoicing (Saudi ZATCA & UAE PINT-AE) Public Engineering API", "version": "1.1.0", "description": "Free, stateless, zero-retention validation API by NBrain (nbra.in) & Eng. Nadeem Mohamed Badr El-Din. Companion to the official MCP Server at https://nbra.in/mcp.", "contact": {"name": "NBrain Engineering", "url": "https://nbra.in/about", "email": "support@nbra.in"}, "license": {"name": "MIT", "url": "https://github.com/NBrain-Studio/nbrain-zatca-mcp/blob/main/LICENSE"}}, "servers": [{"url": "https://nbra.in", "description": "NBrain Production Cloud Run"}], "paths": {"/api/tools/zatca-decode": {"post": {"operationId": "decodeZatcaTlv", "summary": "Decode and validate a Saudi ZATCA Phase 1 or Phase 2 Base64 TLV QR payload", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["payload"], "properties": {"payload": {"type": "string"}}}}}}, "responses": {"200": {"description": "Decoded TLV fields and compliance flags"}}}}, "/api/tools/vat-calc": {"post": {"operationId": "calculateGccVat", "summary": "Compute Decimal-safe VAT for Saudi Arabia (15%), Egypt (14%), Bahrain (10%), UAE/Oman (5%)", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["subtotal"], "properties": {"subtotal": {"type": "string"}, "vat_rate": {"type": "string", "default": "15"}}}}}}, "responses": {"200": {"description": "Exact Decimal subtotal, VAT, and grand total"}}}}, "/api/tools/uae-trn-validate": {"post": {"operationId": "validateUaeTrnAndVat", "summary": "Validate a 15-digit UAE FTA TRN, derive the 10-digit Peppol PINT-AE 0235 TIN, and compute 5% AED VAT", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["trn"], "properties": {"trn": {"type": "string"}, "subtotal_aed": {"type": "string"}}}}}}, "responses": {"200": {"description": "UAE TRN validity, Peppol 0235 endpoint ID, and optional AED totals"}}}}, "/mcp": {"post": {"operationId": "nbrainMcpJsonRpc", "summary": "Streamable HTTP Model Context Protocol (MCP) JSON-RPC 2.0 endpoint", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object"}}}}, "responses": {"200": {"description": "MCP JSON-RPC 2.0 response"}}}}}}