Skip to main content
Glama

Boncourant

Décomposer et réconcilier une facture

decompose_invoice
Read-onlyIdempotent

Agrège des lignes de facture déjà extraites en postes canoniques et vérifie leur somme face aux totaux HT/TTC, sans contrôler les taux. Facture brute : extract_energy_document.

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": {
      "line_items": "<line_items>"
    },
    "name": "decompose_invoice"
  }
}

Input Schema

NameRequiredDescriptionDefault
line_itemsYesLignes de facture déjà extraites.
stated_total_htNoTotal HT déclaré en euros ; null si absent.
stated_total_ttcNoTotal TTC déclaré en euros ; null si absent.

Output Schema

NameRequiredDescriptionDefault
methodNo
outputNo
warningsNo
intermediatesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • addedInput schema / properties / line_items / items / properties / label_raw
      Added value: +{
      +  "anyOf": [
      +    {
      +      "maxLength": 300,
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "Libellé imprimé, non calculé."
      +}
    • addedOutput schema / $schema
      Added value: +"https://json-schema.org/draft/2020-12/schema"
    • changedOutput schema / additionalProperties
      Previous value: -trueNew value: +{}
    • addedOutput schema / properties
      Added value: +{
      +  "intermediates": {
      +    "additionalProperties": {},
      +    "properties": {},
      +    "type": "object"
      +  },
      +  "method": {
      +    "additionalProperties": {},
      +    "properties": {},
      +    "type": "object"
      +  },
      +  "output": {
      +    "additionalProperties": {},
      +    "properties": {},
      +    "type": "object"
      +  },
      +  "warnings": {
      +    "items": {},
      +    "type": "array"
      +  }
      +}
  2. Changed2 schema fields changed
    • changedInput schema / properties / line_items / items / properties / component / description
      Previous value: -"Poste canonique ; other si indéterminé."New value: +"Poste canonique ; subscription = abonnement fourniture ; other si indéterminé."
    • changedInput schema / properties / line_items / items / properties / component / enum
      Previous value: -[
      -  "energy",
      -  "turpe_fixed",
      -  "turpe_variable",
      -  "accise",
      -  "cta",
      -  "tva",
      -  "capacity",
      -  "cee",
      -  "fees",
      -  "other"
      -]New value: +[
      +  "energy",
      +  "subscription",
      +  "turpe_fixed",
      +  "turpe_variable",
      +  "accise",
      +  "tcfe",
      +  "cta",
      +  "tva",
      +  "capacity",
      +  "cee",
      +  "fees",
      +  "other"
      +]
  3. Changed11 schema fields changed
    • changedInput schema / properties / line_items / description
      Previous value: -"Lignes déjà extraites de la facture à agréger et à réconcilier."New value: +"Lignes de facture déjà extraites."
    • changedInput schema / properties / line_items / items / properties / amount_ht / description
      Previous value: -"Montant HT en euros ; négatif pour un avoir, null si absent."New value: +"Euros HT ; négatif si avoir, null si absent."
    • changedInput schema / properties / line_items / items / properties / amount_ttc / description
      Previous value: -"Montant TTC en euros ; négatif pour un avoir, null si absent."New value: +"Euros TTC ; négatif si avoir, null si absent."
    • changedInput schema / properties / line_items / items / properties / amount_tva / description
      Previous value: -"Montant de TVA en euros ; négatif pour un avoir, null si absent."New value: +"Euros de TVA ; négatif si avoir, null si absent."
    • changedInput schema / properties / line_items / items / properties / component / description
      Previous value: -"Poste canonique de la ligne de facture ; conserver other si le poste reste indéterminé."New value: +"Poste canonique ; other si indéterminé."
    • changedInput schema / properties / line_items / items / properties / confidence / description
      Previous value: -"Niveau de preuve de la ligne : confirmé, estimé, indicatif ou données insuffisantes."New value: +"Niveau de preuve de la ligne."
    • changedInput schema / properties / line_items / items / properties / quantity / description
      Previous value: -"Quantité littérale de la ligne dans son unité ; null si absente."New value: +"Quantité littérale ; null si absente."
    • changedInput schema / properties / line_items / items / properties / temporal_class / description
      Previous value: -"Classe tarifaire de la ligne, par exemple HP ou HC ; null si absente."New value: +"Classe, ex. HP ou HC ; null si absente."
    • changedInput schema / properties / line_items / items / properties / unit / description
      Previous value: -"Unité de la quantité facturée, par exemple kWh ; null si absente."New value: +"Unité, ex. kWh ; null si absente."
    • changedInput schema / properties / stated_total_ht / description
      Previous value: -"Total HT déclaré de la facture en euros ; null si absent."New value: +"Total HT déclaré en euros ; null si absent."
    • changedInput schema / properties / stated_total_ttc / description
      Previous value: -"Total TTC déclaré de la facture en euros ; null si absent."New value: +"Total TTC déclaré en euros ; null si absent."
  4. Changed36 schema fields changed
    • addedInput schema / $schema
      Added value: +"https://json-schema.org/draft/2020-12/schema"
    • addedInput schema / properties / line_items / description
      Added value: +"Lignes déjà extraites de la facture à agréger et à réconcilier."
    • addedInput schema / properties / line_items / items / properties / amount_ht / anyOf
      Added value: +[
      +  {
      +    "type": "number"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / line_items / items / properties / amount_ht / default
      Added value: +null
    • addedInput schema / properties / line_items / items / properties / amount_ht / description
      Added value: +"Montant HT en euros ; négatif pour un avoir, null si absent."
    • removedInput schema / properties / line_items / items / properties / amount_ht / type
      Removed value: -[
      -  "number",
      -  "null"
      -]
    • addedInput schema / properties / line_items / items / properties / amount_ttc / anyOf
      Added value: +[
      +  {
      +    "type": "number"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / line_items / items / properties / amount_ttc / default
      Added value: +null
    • addedInput schema / properties / line_items / items / properties / amount_ttc / description
      Added value: +"Montant TTC en euros ; négatif pour un avoir, null si absent."
    • removedInput schema / properties / line_items / items / properties / amount_ttc / type
      Removed value: -[
      -  "number",
      -  "null"
      -]
    • addedInput schema / properties / line_items / items / properties / amount_tva / anyOf
      Added value: +[
      +  {
      +    "type": "number"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / line_items / items / properties / amount_tva / default
      Added value: +null
    • addedInput schema / properties / line_items / items / properties / amount_tva / description
      Added value: +"Montant de TVA en euros ; négatif pour un avoir, null si absent."
    • removedInput schema / properties / line_items / items / properties / amount_tva / type
      Removed value: -[
      -  "number",
      -  "null"
      -]
    • addedInput schema / properties / line_items / items / properties / component / description
      Added value: +"Poste canonique de la ligne de facture ; conserver other si le poste reste indéterminé."
    • addedInput schema / properties / line_items / items / properties / confidence / description
      Added value: +"Niveau de preuve de la ligne : confirmé, estimé, indicatif ou données insuffisantes."
    • addedInput schema / properties / line_items / items / properties / quantity / anyOf
      Added value: +[
      +  {
      +    "type": "number"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / line_items / items / properties / quantity / default
      Added value: +null
    • addedInput schema / properties / line_items / items / properties / quantity / description
      Added value: +"Quantité littérale de la ligne dans son unité ; null si absente."
    • removedInput schema / properties / line_items / items / properties / quantity / type
      Removed value: -[
      -  "number",
      -  "null"
      -]
    • addedInput schema / properties / line_items / items / properties / temporal_class / anyOf
      Added value: +[
      +  {
      +    "maxLength": 80,
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / line_items / items / properties / temporal_class / default
      Added value: +null
    • addedInput schema / properties / line_items / items / properties / temporal_class / description
      Added value: +"Classe tarifaire de la ligne, par exemple HP ou HC ; null si absente."
    • removedInput schema / properties / line_items / items / properties / temporal_class / type
      Removed value: -[
      -  "string",
      -  "null"
      -]
    • addedInput schema / properties / line_items / items / properties / unit / anyOf
      Added value: +[
      +  {
      +    "maxLength": 80,
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / line_items / items / properties / unit / default
      Added value: +null
    • addedInput schema / properties / line_items / items / properties / unit / description
      Added value: +"Unité de la quantité facturée, par exemple kWh ; null si absente."
    • removedInput schema / properties / line_items / items / properties / unit / type
      Removed value: -[
      -  "string",
      -  "null"
      -]
    • addedInput schema / properties / stated_total_ht / anyOf
      Added value: +[
      +  {
      +    "type": "number"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / stated_total_ht / default
      Added value: +null
    • addedInput schema / properties / stated_total_ht / description
      Added value: +"Total HT déclaré de la facture en euros ; null si absent."
    • removedInput schema / properties / stated_total_ht / type
      Removed value: -[
      -  "number",
      -  "null"
      -]
    • addedInput schema / properties / stated_total_ttc / anyOf
      Added value: +[
      +  {
      +    "type": "number"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / stated_total_ttc / default
      Added value: +null
    • addedInput schema / properties / stated_total_ttc / description
      Added value: +"Total TTC déclaré de la facture en euros ; null si absent."
    • removedInput schema / properties / stated_total_ttc / type
      Removed value: -[
      -  "number",
      -  "null"
      -]
  5. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive/closed-world, so the safety profile is covered; the description adds genuinely new behavior: lines are mapped to canonical postes and their sum is checked against the declared totals, and rate validation is deliberately out of scope. The one real gap is what happens when the sum does not match — a failure, or a reported discrepancy — which the agent cannot infer.

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

Conciseness5/5

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

Two dense sentences with zero filler: the operation and its verification step come first, the scope limit second, and the upstream alternative last. Nothing is repeated from the schema or the title.

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 a read-only reconciliation tool with a full schema and an output schema, the definition supplies the essential missing pieces: the input precondition, the comparison being performed, and the explicit exclusion of rate checking. Only the mismatch-handling behavior is left open, which the output schema can reasonably carry.

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

Parameters3/5

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

Schema coverage is 100% and every field, including the component enum and the null conventions, is documented in the schema itself. The description adds only the framing that stated_total_ht/ttc serve as the reconciliation reference; it gives no extra detail on how line_items are grouped or how nulls/confidence levels are handled.

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?

States a specific verb pair (agrège / vérifie) on a specific resource (lignes de facture déjà extraites → postes canoniques) and adds the reconciliation scope against HT/TTC totals. It also names the sibling that handles the upstream step ('Facture brute : extract_energy_document'), so the agent can separate the two without opening either schema.

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?

The precondition ('déjà extraites') and the alternative for raw invoices (extract_energy_document) give clear routing guidance, and 'sans contrôler les taux' is an explicit scope exclusion. It stops short of full when/when-not coverage because it doesn't say what to do when totals are absent or which sibling handles downstream annualization/analysis.

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.