backfill_purchase_register
ChatGPTUse this when the user asks to add to the purchase register the lines missing for received e-invoices already marked paid. Creates one line per paid received invoice that has none, with the invoice's VAT breakdown, and skips invoices with no identifiable supplier (a received credit note enters as a negative line); idempotent and safe to run. Deleting a register line is done only in the app.
backfill_receipts
ChatGPTUse this when the user asks to add to the receipts ledger the cash-ins missing for invoices already marked paid (e.g. legacy invoices paid before receipts were booked automatically). Creates one income line per paid invoice that has none (never for an invoice settled by a credit note, a repair-bonus invoice or a zero invoice, like the app); a line dated in an already declared URSSAF period is recorded but stays outside that declaration, and the response says so. Idempotent and safe to run. Deleting a ledger line is done only in the app.
delete_draft_document
ChatGPTUse this when the user asks to delete a draft quote or invoice, only while it is still a draft. An issued document is never deleted: an issued invoice is cancelled by a credit note. An old credit note draft can be deleted when it carries no refund receipt and is applied to no invoice.
fetch
ChatGPTUse this when you already have a fluxmicro:// URI and need the targeted entity details, lines, or web/PDF links without listing unrelated data. A receipt or purchase exposes its accounting category, whether a supporting document is attached (boolean only, never the file), its VAT state (proposed, validated, to_complete), its recorded tax_rate_bps and its recorded per-rate vat_breakdown — read that breakdown before correcting the amount of an entry that mixes several rates, and resend it, never a split you made up. A quote or invoice lists its internal attachments (name, size_bytes, created_at): read-only, never sent to the client, the files stay in the app. links.web_url opens that exact quote, invoice or credit note in the app. A receipt also carries urssaf_standing: status outside_declaration means it was noted after its period was declared in FluxMicro and is not in that declaration (relay its note: the declaration is corrected at the Urssaf, then marked "Marquer rectifiee..." in the FluxMicro app when the receipt sheet offers it, never here); other statuses are declared, declared_outside_fluxmicro, to_declare, upcoming, not_counted.
finalize_document
ChatGPTUse this when the user asks to issue (émettre) a draft quote or invoice: it receives its number and can no longer be deleted. Credit notes are issued when created by issue_credit_note; an old credit note draft cannot be issued (delete it, then create the credit note again). An invoice goes through the app's VAT issuance check (same engine): it freezes the operation kind, each line's VAT category and territory, the exemption reason and the legal VAT mentions. Refusals use the app's codes: vat_blocking (inconsistent VAT such as a rate under the franchise or outside the territory's rates; blocks every plan) and vat_to_qualify (open VAT question such as a VIES check or the 259 B question; blocks where the VAT sheet exists). The refusal lists the engine's issue and question ids: fix the draft with save_document_draft or ask the user to act in the app; never answer a VAT question or attest a VIES check on the user's behalf. Non-blocking VAT warnings (such as a 0 % line on a sale in France) come back in warning and vat_warnings: relay them to the user.
get_business_status
ChatGPTUse this when the user asks for their current business status, missing configuration, alerts, overdue documents, or recommended next actions. status.missing_settings lists what still blocks issuing an invoice, like the app's home screen. status.urssaf.pending (null when nothing is due) gives the URSSAF declarations to make, the oldest first, with its deadline, whether it is overdue and the amount to pay; they are made in the app (/urssaf), never here. status.recommendations are sentences written for the user: relay them as they are. It also carries the read-only VAT block (period, status, amount, deadline, blocking items): the VAT return is validated and filed only in the app at /tva, never here. status.urssaf.applicable=false means the business is under the real regime (régime réel): say that URSSAF does not apply, never estimate a contribution. status.overdue_invoice_count and status.overdue_amount cover every overdue invoice, like the app; alerts only detail the oldest ones (status.overdue_alert_count). status.urssaf_rectifications lists the declarations made in FluxMicro that lines noted after them leave to correct (period, online_until while it can still be changed online, corrected revenue per category, note to relay): the correction is made at the Urssaf, then marked "Marquer rectifiee..." in the FluxMicro app when the receipt sheet offers it (the note says so), never here.
get_fluxmicro_context
ChatGPTUse this when you need the active FluxMicro organization, its plan and capabilities, MCP permissions, product limits, excluded actions, and useful URLs before deciding the next tool call. invoicing.can_issue_documents and missing_required_for_invoicing say what still blocks issuing an invoice and which update_settings fields fix it. Sales conditions are summarized (sales_conditions_present, sales_conditions_chars), never returned in full. mcp_rules.e_invoicing: this server has no tool to send an e-invoice; issuing an invoice follows the app's rules, e-invoice included.
get_kpis
ChatGPTUse this when the user asks for KPIs over a period (Paris days; default: since January 1st). Request level=basic; level=advanced only when capabilities.can_view_advanced_kpis is true (otherwise FEATURE_UNAVAILABLE_FOR_ACCOUNT: say these indicators are not available on this account, without pushing any offer). Under the real regime (basic.urssaf_applicable=false) no URSSAF estimate and no micro-enterprise ceiling are published (null): report 'URSSAF not applicable under the real regime' instead of a number. basic.cash_in is the receipts ledger total excluding VAT with refunds deducted (basic.amount_basis), the same figure as the app; basic.purchases is the purchase register total incl. VAT; basic.net_cash subtracts purchases in the SAME basis as cash_in (basic.net_cash_basis). basic.urssaf_estimate covers social contributions only (no training contribution, no chamber tax, not rounded): for the amount to pay for a period use render_view view=fiscal. basic.amount_due only counts invoices issued in the period that are still awaiting payment, never drafts.
get_vat_entries
ChatGPTUse this when the user asks which pieces feed a VAT period, why a sale or a purchase is (or is not) in the VAT return, what is still missing before filing, or what was left out on purpose. Returns the VAT journal of one period: each invoice, receipt, credit note, imported charge, purchase or VAT-only entry with its dated events, the rule that dates them, the VAT it brings to that period, what it still misses, the engine's lawful assumptions (e.g. goods delivered on the invoice date), and its state, the same as the app's /tva/ecritures page (state and state_label): valide, a-completer, propose (purchase deductible by default, to confirm in the app), ecartee (left out by the user, or by a rule such as OSS sales or goods invoiced with another EU country's VAT: rule_excluded gives the reason), declaree, reprise or regularisation (from an earlier period), en-attente (invoice awaiting payment), annulee (nothing to declare), apres-depot (added after the return was filed), attente-periode, hors-periode. Paginated: limit (default 25, max 50) and next_cursor; totals cover the whole period. A period key missing from the filing calendar opens the period the app is working on and period_notice says so. READ-ONLY: completing a piece, excluding or re-including it, adding a VAT-only entry and filing the return all happen in the app (see app_url), never here.
issue_credit_note
ChatGPTUse this when the user asks to cancel or refund an issued invoice, fully or partly: a CREDIT NOTE (avoir) is the only way, exactly like the app. Pass source_invoice_id (+ kind refund|credit, + credit_scope). It is ISSUED AND NUMBERED IN THIS CALL (there is no credit note draft and it can never be deleted afterwards), so confirm the invoice, the amount and the kind with the user first. It first settles what the client still owes on that invoice (an unpaid invoice is voided, with nothing to refund); only the already-collected excess is refunded (kind=refund, then record the refund with update_document_state state=paid) or kept as credit for a later invoice (kind=credit, applied with applied_credit_note_id). Its lines and totals are derived from the invoice.
lookup_company
ChatGPTUse this when you need to enrich a client or supplier from a French SIREN/SIRET using the public company directory (INSEE SIRENE, an external service). Returns the fields upsert_client accepts (legal_name, trade_name, siren, siret, ape, address, postal_code, city, country). If name_required is true, the directory does not publish the name: ask the user for it, never invent it. Limited like the app: 20 lookups per minute, then a 5-minute pause (RATE_LIMITED). SIRENE_UNAVAILABLE means the directory is down: retry later or let the user type the details.
record_purchase
ChatGPTUse this when the user asks to create a manual purchase register line, or to correct an existing one (id) — including a line booked by marking a received e-invoice paid: its payment date or payment method is corrected here, under the declared-period locks. VAT: deductibility_category (+ deductibility_precision or vat_deductible_ratio_bps when the category needs it) is resolved into a rule by the same engine function as the app's VAT sheet; vat_deductibility_rule remains available (45 closed rules, required with category autre); an update that sends neither keeps the recorded rule. accounting_category is the register's closed list. supplier_debit_option applies to services only. Any VAT field needs vat_nature (goods, services or fixed_asset), a new purchase with any VAT field needs issued_at (the supplier's invoice date), and goods or a fixed asset need delivered_at: each is refused when missing, like the app. Never guess any of them: ask the user. Bought abroad: service_month (month of a reverse-charged service), import_vat_paid, french_vat_charged and eu_goods_threshold_exceeded answer the app's questions; omitted, the app's defaults apply (see each field), and the result says the month retained (vat_month). A supplier credit note on a reverse-charged expense: credit_note_of (the expense id) with subtotal_cents and issued_at, nothing else to qualify. When the invoice already bears French VAT (french_vat_charged) or the import VAT was already paid (import_vat_paid), an organization that charges VAT recovers none of it (VAT invoiced where it was not due): the result says so. Goods bought in the EU whose invoice bears the seller's own VAT (goods_invoice_answer = vat_charged): tax_cents is ignored and that foreign VAT (its rate goes in foreign_vat_rate_bps) is never deducted in France, but the purchase remains an intra-EU acquisition taxable in France (for an organization that charges VAT, and for a franchisé above the 10,000 EUR threshold): the VAT return declares its base net of the seller's VAT and the FRENCH VAT at tax_rate_bps (the French rate of the goods, standard rate when omitted or not a French rate; e.g. 550 for a book), deducted like any reverse charge for an organization that charges VAT; the result says so (vat_not_recoverable) with what to do. A franchisé that does not file VAT (no VAT module) may still send supplier_country, place_bound_service, french_vat_charged and eu_goods_threshold_exceeded: they are kept on the expense like in the app, nothing is self-assessed, and franchise_notice says what the app says. Amounts are frozen once the VAT period is declared; excluding or validating a purchase for VAT and filing the return happen only in the app at /tva. Deleting a register line is not possible here: it is done in the app (purchase register). When the supplier's EU VAT number still needs checking, FluxMicro queues the same VIES check as the app (a lookup in the EU registry); it never contacts the supplier nor sends any e-invoicing status (only update_purchase_invoice_state does).
record_receipt
ChatGPTUse this when the user asks to record a MANUAL cash-in in the receipts ledger that is not tied to a FluxMicro invoice (including a manual refund entry, direction=refund), or to correct an existing ledger line (id). Invoice payments must go through update_document_state (state=paid) instead, which books the receipt automatically — also calling record_receipt for that payment would double-count the revenue. Lines generated from an invoice or a credit note CAN be corrected here, like in the app: client, reference, payment method, label and notes stay editable; amounts, URSSAF split, direction and inclusion follow the app's locks (frozen once the URSSAF or VAT period is declared; a line linked to an invoice never exceeds what is still due). The cash-in date of a recorded line never changes (omit received_at on an update). For a micro-enterprise, a line split across several URSSAF bases needs a new split (urssaf_basis_kind=mixed) when its net amount changes. VAT: tax_rate_bps/vat_breakdown follow the same rules as the app (rate allowed on the org's territory); vat_item_type (derived from the URSSAF base, checked not chosen), delivered_at (goods, it dates the VAT) and electronic_service (services) only apply to a manual receipt of a VAT-liable organization with the VAT module. Under the real regime URSSAF does not apply and included_in_urssaf cannot be changed. Deleting a ledger line is not possible here: it is done in the app (receipts ledger), which only deletes manual lines. The VAT return itself is filed only in the app at /tva.
render_view
ChatGPTUse this when the user asks to show, display, open, or preview a dashboard, KPIs, business status, URSSAF/fiscal status (view=fiscal: current period contributions, rate and deadline), VAT status (view=tva: current period, amount due or credit, deadline and blocking checklist items — READ-ONLY, the VAT return itself is filed only in the app at /tva), list, entity detail, document, or action result in an integrated UI. For document or entity preview, first obtain the fluxmicro:// URI with search or fetch, then call render_view with view=document or view=entity_detail and uri; do not answer with PDF links only when an integrated UI is available.
save_document_draft
ChatGPTUse this when the user asks to create or modify a draft quote or invoice. Provide line items for a brand-new quote or invoice; on an update (id given) omit what does not change — the client, the lines and every other field keep their stored value. A line without tax_rate_bps takes the catalog item's rate, otherwise the normal rate of the organization's territory (0 under the VAT franchise), like the app. To BILL AN ACCEPTED QUOTE (devis -> facture), pass source_quote_id instead of re-typing lines — the client, lines, totals and reference are copied from the quote and the sourceQuoteId link is kept (the quote must be sent or accepted). Then call finalize_document to issue the quote or invoice. A credit note (avoir) is never a draft: create it with issue_credit_note. VAT sheet answers: electronic_service per service line and out_of_scope_259b (consumer outside the EU) are stored on the draft as the user answered them — never guess them. This tool never adds a line to the catalog: to keep a typed line as a reusable item (the app's 'Garder dans mes articles' switch), create it with upsert_catalog_item (type required; electronic_service for a service) and reference it on the line with catalog_item_id.
search
ChatGPTUse this when you need a compact paginated list or search across clients, products, quotes, invoices, credit notes, receipts, purchases, imported charges, or suppliers. Text search is case-insensitive and matches like the app's lists (document number, client name or exact amount incl. VAT; client name, trade name, email, SIREN, SIRET). Invoice status filters use the displayed status (overdue from the effective due date, paid including invoices settled by credit notes). Documents are filtered on their issue date (creation date while still a draft). Clients carry ca_year_cents (revenue cashed this year) only when the search targets clients alone, null otherwise. Receipts and purchases carry accounting_category (purchases only, null on receipts), has_attachment (whether a supporting document is attached; the file itself is never exposed) and vat_state: proposed (purchase taken as deductible by default, to confirm in the app), validated, or to_complete.
send_document
ChatGPTUse this when the user asks to send an issued quote, invoice, or credit note by e-mail to its client. The e-mail only goes to the address on the document's client record (or frozen on the document); recipient_email and cc_email accept only that address, the seller's contact address or the user's own address. If the client's e-mail was changed through this assistant less than 24 hours ago, sending is refused (CLIENT_EMAIL_RECENTLY_CHANGED): the user checks the address and sends from the app. The daily sending limit of the plan is the same as in the app. For an invoice paid by transfer the e-mail shows the IBAN in clear; hide_iban_in_email: true hides it in this e-mail only (the PDF keeps its own choice), like the app's sending window.
update_document_state
ChatGPTUse this when the user asks to update a document state such as accepted, rejected, paid, partially_paid, archived, restored, or sent when allowed. Always pass idempotency_key (REQUIRED for paid and partially_paid): a replayed call then never books the same payment twice. Quotes follow the same state machine as the app: draft→issued|archived, issued→sent|expired|archived, sent→accepted|rejected|expired|archived, accepted|expired→archived, rejected→sent|archived; a quote already turned into an invoice can no longer be rejected. Marking an invoice paid or partially_paid automatically records the matching URSSAF receipt (the cashed revenue enters the URSSAF base, exactly like the web app) — do NOT also call record_receipt for that same invoice. For a partial settlement pass payment_amount_cents (in cents); a partially paid invoice cannot go back to issued or sent. A REFUND credit note accepts state=sent from the issued state, and state=paid (+ payment_method) to book its refund in the receipts ledger; a credit note of kind credit is used through applied_credit_note_id instead; a credit note draft accepts neither. Use state=archived / state=restored to archive or restore any document type. Issuing a draft goes through finalize_document. To cancel or refund an invoice, create a credit note with issue_credit_note, exactly like the app: no state writes canceled or refunded directly.
update_purchase_invoice_state
ChatGPTUse this when the user asks to review, archive or annotate a received e-invoice (imported charge), or to mark it paid. Marking it paid needs paid_at AND payment_method (never guess the payment method, ask the user): it books the purchase register AND sends the status "payment sent" (fr:211) to the supplier through the e-invoicing platform, exactly like the app — an effect outside FluxMicro that cannot be undone; never sent for a received credit note. Tell the user before marking it paid. A received invoice already paid or already in the purchase register cannot be marked paid again (ALREADY_PAID): correct its register line with record_purchase. A received invoice the supplier refused can no longer be marked paid.
update_settings
ChatGPTUse this when the user asks to update FluxMicro organization settings, legal details, payment terms, numbering, or email/design settings when enabled for the account. Only the fields you send change. It stays inside FluxMicro: it never contacts the payment provider itself and never changes the subscription (done by the user in the app); when the company identity changes (legal name, SIREN/SIRET, VAT number, contact, address), FluxMicro refreshes the billing details of the user's own FluxMicro subscription in the background, exactly as the app does. The VAT regime, the IBAN and the online payment link are read-only here. A missing VAT number under the standard regime is reported in warning, not refused; rules for professional clients (late-payment rate, 40 € recovery fee, 60-day terms) are enforced like in the app.
upsert_catalog_item
ChatGPTUse this when the user asks to create or update an item (product or service) in the FluxMicro catalog. type (service or product) is required to create an item, like in the app; on every save the type, sent or kept, must match the organization's activity (a services-only account cannot keep a product). electronic_service applies to services only and descends onto the document lines that reference the item. Under the VAT franchise, tax_rate_bps is not stored, like in the app.
upsert_client
ChatGPTUse this when the user asks to create or update a FluxMicro client that they could edit in the app. On an update, only the fields you send change. country takes the app's country list (ISO code such as FR, BE, DE, or a country name): anything else is refused, never stored. The VAT number can be entered but never marked as verified (the user checks it in the app).