# Catalogue

Les outils du catalogue permettent de gérer vos produits et services. Ces produits peuvent ensuite être utilisés dans les lignes de facturation.

{% hint style="warning" %}
Tous les montants sont exprimés en **centimes** (100€ = 10000). Consultez les [conventions](/mcp/conventions.md) pour plus de détails.
{% endhint %}

## Lecture

### `get-products`

Récupère les produits du catalogue avec pagination (100 produits par page).

**Paramètres**

| Paramètre | Type   | Requis | Description                            |
| --------- | ------ | ------ | -------------------------------------- |
| `page`    | number | Non    | Numéro de page (défaut : 1)            |
| `search`  | string | Non    | Recherche par désignation ou référence |

**Réponse**

```json
{
  "success": true,
  "total": 25,
  "page": 1,
  "limit": 100,
  "totalPages": 1,
  "hasNextPage": false,
  "hasPrevPage": false,
  "products": [
    {
      "id": "string",
      "designation": "Développement web",
      "reference": "DEV-001",
      "description": "Prestation de développement web",
      "type": "SERVICE_DELIVERY",
      "unit": "HOUR",
      "unitPrice": 7500,
      "priceWithoutTaxes": 7500,
      "priceWithTaxes": 9000,
      "purchasePrice": 0,
      "productMargin": 0,
      "vatCode": "FR_2000",
      "vatAmount": 1500,
      "taxesIncluded": false,
      "stock": 0,
      "isStockable": false,
      "isDeliveryOfGood": false,
      "personalServiceActivity": false
    }
  ]
}
```

***

### `get-product-by-id`

Récupère le détail complet d'un produit par son identifiant.

**Paramètres**

| Paramètre   | Type   | Requis | Description            |
| ----------- | ------ | ------ | ---------------------- |
| `productId` | string | Oui    | Identifiant du produit |

***

## Création et modification

### `create-product`

Crée un nouveau produit dans le catalogue.

**Paramètres**

| Paramètre          | Type        | Requis | Description                                               |
| ------------------ | ----------- | ------ | --------------------------------------------------------- |
| `designation`      | string      | Oui    | Nom du produit ou service                                 |
| `type`             | ProductType | Oui    | Type (ex : `SERVICE_DELIVERY`, `GOODS_SALE`)              |
| `unit`             | ProductUnit | Oui    | Unité (ex : `HOUR`, `DAY`, `UNIT`, `KG`)                  |
| `vatCode`          | VatCode     | Oui    | Code TVA (ex : `FR_2000`, `FR_1000`, `FR_00HT`)           |
| `unitPrice`        | number      | Non    | Prix unitaire en **centimes**                             |
| `purchasePrice`    | number      | Non    | Prix d'achat en **centimes** (pour calcul de marge)       |
| `productMargin`    | number      | Non    | Marge en pourcentage (30 = 30%)                           |
| `lockUnitPrice`    | boolean     | Non    | Prix fixe, non calculé depuis marge (défaut : `false`)    |
| `taxesIncluded`    | boolean     | Non    | Prix TTC (défaut : `false` = HT)                          |
| `isDeliveryOfGood` | boolean     | Non    | Livraison de bien pour la comptabilité (défaut : `false`) |
| `description`      | string      | Non    | Description détaillée                                     |
| `reference`        | string      | Non    | Référence / SKU                                           |
| `stock`            | number      | Non    | Stock initial (défaut : 0)                                |

***

### `update-product`

Met à jour un produit existant. Les paramètres `designation`, `type`, `unit` et `vatCode` sont requis (le produit est remplacé intégralement).

**Paramètres**

Identiques à `create-product`, avec en plus :

| Paramètre   | Type   | Requis | Description            |
| ----------- | ------ | ------ | ---------------------- |
| `productId` | string | Oui    | Identifiant du produit |

***

### `delete-product`

Supprime définitivement un produit du catalogue. **Action irréversible.**

**Paramètres**

| Paramètre   | Type   | Requis | Description            |
| ----------- | ------ | ------ | ---------------------- |
| `productId` | string | Oui    | Identifiant du produit |

***

## Scopes requis

| Outil                                                | Scope           |
| ---------------------------------------------------- | --------------- |
| `get-products`, `get-product-by-id`                  | `catalog:read`  |
| `create-product`, `update-product`, `delete-product` | `catalog:write` |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.abby.fr/mcp/catalogue.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
