Skip to main content
Glama

Préparer un brouillon de facture ou de devis

create_invoice_draft

Prépare un BROUILLON de facture (definitive), de devis (quote), de proforma ou de facture d'acompte (acompte) pour un client existant. Référence : une facture ou une facture d'acompte en brouillon porte une référence provisoire BR-… (son numéro DEF-… ou ACPT-… lui est donné à l'émission) ; un devis reçoit tout de suite son numéro DEVIS-…, une proforma PROF-…. Le brouillon n'est ni émis, ni envoyé au client, ni payé, et ne modifie ni le stock ni la comptabilité : un utilisateur le relit et l'émet dans SAMA Entreprise (lien renvoyé). customer_id, product_id et service_id sont des identifiants existants. Chaque ligne porte un produit ou une prestation ; une prestation à facteurs se décrit par calculations (une ligne par pièce, équipe, journée… ; values dans l'ordre des facteurs de la prestation) ; options = libellés des options choisies. Remise (discount_amount), frais de livraison (delivery_amount) et retenue (retenue_type) sont facultatifs.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "customer_id": "<customer_id>",
      "items": "<items>"
    },
    "name": "create_invoice_draft"
  }
}

Input Schema

NameRequiredDescriptionDefault
typeNodefinitive = facture (défaut), quote = devis, proforma = proforma, acompte = facture d'acompte.definitive
itemsYesLignes du document : chacune porte un produit ou une prestation, avec sa quantité.
notesNoNotes du document (facultatif).
subjectNoObjet du document (facultatif).
due_dateNoYYYY-MM-DD
tax_rateNoTaux de TVA en % (défaut 18).
customer_idYesIdentifiant d'un client existant.
invoice_dateNoYYYY-MM-DD
retenue_typeNoRetenue : PRECOMPTE_TVA (client public qui retient toute la TVA, art. 372 CGI) ou RAS_5 (5 % du HT, prestataire personne physique, art. 200). Ne change pas le total : réduit le net à payer.
delivery_amountNoFrais de livraison en FCFA (ex: 1500). Ajoutés au total.
discount_amountNoRemise globale en FCFA (ex: 500). Déduite du total.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the annotations, it discloses the key side-effect profile: no stock or accounting mutation, no sending, no payment, plus the reference-numbering rules (BR- provisional, DEF-/ACPT- on issue, DEVIS-/PROF- immediate) and the returned review link. This adds genuinely decision-relevant behavior the annotations do not convey.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose and draft-vs-issued distinction are front-loaded, and every clause carries information (document types, numbering, side effects, line semantics). It is dense — a single long paragraph with semicolons — so it could be split into scannable sentences, but nothing is redundant.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 11-parameter creation tool with no output schema, it covers all the gaps: what gets created, what is not mutated, how references are assigned, how nested line items and factor-based services are expressed, and what is returned (a link to issue). Nothing essential is left implicit.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3; the description earns above that by tying parameters together — customer_id/product_id/service_id must be existing IDs, each line carries either a product or a service, a factor-based service is described via `calculations` with one row per room/team/day and `values` in factor order, `options` are chosen option labels, and discount/delivery/retenue are optional.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a precise verb+resource: 'Prépare un BROUILLON de facture ... de devis ... de proforma ou de facture d'acompte pour un client existant'. It enumerates the four document types the tool covers and immediately scopes what a draft is (not issued, not sent, not paid), which cleanly separates it from the read-only get_*/list_* siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives clear usage context: the draft is prepared for an existing customer, and a human must review and issue it in SAMA Entreprise via the returned link. There are no explicit exclusions or named alternatives, but the workflow boundary (prepare here, issue there) is unambiguous and no sibling create tool exists.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources