# Simple Fatoora MCP

> Simple Fatoora connects your AI agent directly to ZATCA-compliant e-invoicing for Saudi businesses. This server lets you manage clients, track inventory, and generate simplified or VAT invoices—all through natural conversation. It handles automated tax calculations and embeds the required QR codes, eliminating manual accounting headaches.

## Overview
- **Category:** industry-titans
- **Price:** Free
- **Tags:** e-invoicing, zatca-compliance, tax-calculation, qr-code-generation, accounting, saudi-tax

## Description

Simple Fatoora connects your AI agent right to ZATCA-compliant e-invoicing for Saudi businesses. You're running core accounting tasks—managing clients, tracking inventory, and generating simplified or VAT invoices—all through natural conversation. It handles automated tax calculations and embeds the required QR codes; you won't have any manual accounting headaches.

### Client Records Management

You can keep your client book clean with several tools. To start fresh, you tell your agent to run `create_client`, which builds a brand-new customer profile in your database. Need to fix an address or update a tax ID? Use `update_client` on an existing record. If the client is gone for good, you'll use `delete_client` to wipe that record entirely.

When you need to know who you're dealing with, you have options: Run `list_clients` and you get a full roster of every single client currently in your system. Or, if you just know the ID number, calling `get_client(ID)` pulls all specific details for that one person. If you're managing contacts regularly, these tools let you handle everything from creation to deletion.

### Product and Catalog Management

Making sure your product list is accurate is key. You can pull a summary of every item or service you sell by running `list_items`, which also shows the current pricing for each one. If you have a new widget or a service that didn't make the cut, you just run `create_item` to add it straight into your billing catalog. This keeps everything accurate when an invoice needs generating.

### Invoice Generation and Tracking

The server provides specialized tools for creating invoices. For consumers (B2C), running `create_simplified_invoice` generates a simplified tax invoice, automatically checking all the compliance boxes you need. When you deal with other businesses (B2B) that require full VAT documentation, calling `create_vat_invoice` handles that complex payload using specific client and item data to ensure total adherence to regulations.

You don't just create invoices; you track 'em. Running `list_invoices` gives you a high-level summary of all your accounts receivable, showing statuses like 'Paid,' 'Draft,' or whatever state the invoice is in. If you need the full scoop on one specific bill—maybe to check if it was paid out yet—you use `get_invoice(ID)` to fetch the complete data and current status for that single record.

### Operational Flow

Your AI agent acts like a dedicated finance manager sitting next to you. You tell your agent exactly what job needs doing—for example, 'Invoice John Doe for 500 SAR using simplified rates.' The agent then automatically calls the sequence of tools required: it'll validate that client first, confirm the items exist in the catalog, and finally execute `create_simplified_invoice`. This process handles every compliance detail, including tax calculations and QR code embedding, without you having to switch tabs or manually enter anything.

## Tools

### create_client
Creates a brand-new customer profile in your database.

### create_item
Adds a new product or service to your item catalog for billing purposes.

### create_simplified_invoice
Generates a simplified tax invoice (B2C) by taking items and client details as input.

### create_vat_invoice
Creates a full VAT tax invoice (B2B) using specific item and client data payloads.

### delete_client
Removes an existing client record from your system entirely.

### get_client
Retrieves all specific details for one client using their unique ID number.

### get_invoice
Fetches the complete data and status of a single invoice record by its ID.

### list_clients
Retrieves a comprehensive list of every client currently in your database.

### list_invoices
Pulls a summary list of all invoices, showing their status and IDs.

### list_items
Lists every product or service available in your catalog, including current pricing.

### update_client
Modifies details (like address or tax ID) for an already existing client profile.

## Prompt Examples

**Prompt:** 
```
List all active invoices in Simple Fatoora.
```

**Response:** 
```
I've retrieved your invoices. You have 5 active records including 'INV-1001' (Paid) and 'INV-1002' (Draft). Would you like the full PDF data for any of them?
```

**Prompt:** 
```
Create a simplified invoice for client 'John Miller' with a 'Consultation' item for 500 SAR.
```

**Response:** 
```
Simplified invoice created! Client: John Miller, Item: Consultation, Total: 500 SAR. The invoice is ZATCA-compliant. Should I retrieve the QR code data for you?
```

**Prompt:** 
```
Search for a client named 'Acme Corp' in my database.
```

**Response:** 
```
Searching clients... I found one match for 'Acme Corp' (ID: 98765). They have a registered VAT number and 3 previous invoices. Would you like to see their contact history?
```

## Capabilities

### Create New Clients
The agent uses `create_client` to establish a new contact profile within your Simple Fatoora account.

### Generate Simplified Invoices (B2C)
You prompt the server, and it runs `create_simplified_invoice`, generating a tax invoice for consumers with automated compliance checks.

### Manage Client Records
The agent can list all existing clients using `list_clients` or fetch specific details by calling `get_client(ID)`.

### Track and List Invoices
It uses `list_invoices` to pull a summary of your accounts receivable, showing statuses like 'Paid' or 'Draft'.

### Update Item Catalog
The agent executes `create_item` or `update_client` to ensure your product list and customer data remain current.

## Use Cases

### End-of-Month Reconciliation
The finance manager needs to reconcile 30 days of sales. Instead of downloading reports and comparing spreadsheets, they ask the agent: 'Show me all invoices from last month that are marked as Draft.' The system runs `list_invoices` and filters them instantly, providing a clear list for follow-up.

### Onboarding a New Partner
A new B2B client signs on. The sales team asks the agent to create a profile: 'Create a client named Global Tech with VAT ID 12345.' This triggers `create_client` and saves all necessary tax details immediately, ready for billing.

### Correcting an Old Invoice
A product price changed. Instead of manually updating old records, the operations manager tells the agent: 'Update item ID 50 to $120.' This runs `create_item` or equivalent update tool, ensuring all future invoices use the correct pricing.

### Generating a Quick Invoice
A client calls with an immediate need for billing. The agent takes their name and item details, running `get_client(ID)` first to validate tax info, then calling `create_simplified_invoice` using the validated data.

## Benefits

- Stop manually calculating tax rates. When you generate an invoice using `create_simplified_invoice` or `create_vat_invoice`, the server handles all automated calculations and compliance checks instantly.
- Never lose client data again. You can run `list_clients` to see every recorded customer, or use `get_client(ID)` to pull detailed contact and tax info for a specific person.
- Keep your product catalog accurate with `create_item`. Before billing, you can list all available items using `list_items` and verify pricing before generating any invoice.
- Accountability is clear. By calling `get_invoice(ID)`, you don't just get the document; you get its full metadata and current status (Paid/Draft), letting you track accounts receivable without logging into a separate dashboard.
- Reduce clicks by managing data flow. Instead of updating client info in one place and items in another, you use `update_client` or `create_item` directly via natural language commands.

## How It Works

The bottom line is that your AI client acts as an automated finance operations manager, executing complex multi-step financial tasks through simple conversation.

1. First, authorize the connection by subscribing to the server and providing your Simple Fatoora API Key.
2. Next, direct your AI client to perform a task, such as asking it to 'Create an invoice for Client XYZ.'
3. The agent sequences the necessary tool calls (e.g., `get_client` then `create_vat_invoice`), handles the tax calculations, and returns a confirmation of the compliant record.

## Frequently Asked Questions

**How do I generate an invoice for a B2B client using the create_vat_invoice tool?**
You prompt your agent to run `create_vat_invoice` and provide the items as a JSON string. The system requires specific item details and passes them through automated tax calculations, ensuring full VAT compliance.

**Does Simple Fatoora MCP Server handle simple invoices for consumers?**
Yes. Use `create_simplified_invoice` when billing a consumer (B2C). This tool is specifically designed to generate the simplified tax invoice while maintaining ZATCA compliance.

**What if I need to change an item's price? Should I use create_item or update_client?**
Item prices belong in your product catalog. You must run `create_item` or a similar dedicated function for pricing changes, as the client details are handled by `update_client`.

**Can I find out if a client exists before invoicing?**
Absolutely. Run `get_client(ID)` to retrieve all known data on that person using their ID. This confirms the record is active and complete before you attempt any billing.

**What API key credentials do I need to use the `list_clients` tool?**
You must provide your Simple Fatoora API Key from your dashboard settings. This key authorizes your AI client to access and read all your account data, allowing you to list clients successfully.

**If I need to adjust a client's tax number or contact info, how does the `update_client` tool work?**
The `update_client` tool modifies specific fields of an existing record using the provided Client ID. You only send the data you want to change; it won't overwrite other untouched profile details.

**What should I do if the item JSON string fails validation when calling `create_vat_invoice`?**
The agent will return a specific error message detailing exactly which field or format is incorrect. Check the required structure of your items before retrying the invoice creation command.

**Does running the `delete_client` tool permanently remove all data associated with that client?**
Yes, calling `delete_client` removes the record from Simple Fatoora. This action is final and irreversible; always verify the Client ID before executing the deletion command.

**Can my AI automatically create a ZATCA-compliant VAT invoice for a customer?**
Yes! Use the `create_vat_invoice` tool. Provide the client details and item list, and your agent will generate a compliant ZATCA Phase 2 invoice instantly.

**How do I check the stock level for a specific item in Simple Fatoora?**
Simply ask the agent to run the `list_items` action. It will retrieve the current inventory catalog, including stock counts and pricing for all items.

**How do I find my Simple Fatoora API Key?**
Log in to your Simple Fatoora dashboard, navigate to **Settings** > **API Integration**, and you will find your unique secret API Key there.