Skip to main content
Glama
mcp-lettrage

mcp-lettrage

by m02xime

expliquer_ecart

Read-only

Classify and explain discrepancies between a payment and one or more invoices, returning the gap type, amount, reason, and accounting entry to post.

Instructions

Qualifie l'écart entre un paiement et une ou plusieurs factures : aucun, paiement_partiel, trop_percu, escompte (taux prévu sur la facture), avoir (avoir non imputé du client qui couvre exactement l'écart), double_paiement (factures déjà soldées). Renvoie le type, le montant de l'écart (|reste dû − montant reçu|), une explication et l'écriture à passer. À appeler pour confirmer un candidat dont l'écart n'est pas nul.

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": {
      "factures": "<factures>"
    },
    "name": "expliquer_ecart"
  }
}

Input Schema

NameRequiredDescriptionDefault
avoirsNoAvoirs que le client a déduits, si connus
montantNoMontant reçu, si pas de releve_id
facturesYesNuméros des factures, ex. ["F2026-0418"]
releve_idNoId de la ligne de relevé

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

The readOnlyHint already tells the agent nothing is mutated; the description usefully adds that the "écriture à passer" is a proposed journal entry returned as text, not a write it performs, which resolves a real ambiguity for an accounting agent. It also discloses the exact gap formula (|reste dû − montant reçu|), though it says nothing about failure modes for unmatched or ambiguous inputs.

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?

A single dense paragraph that is front-loaded with the purpose, then the taxonomy, then the return values, then the call condition — every clause carries information. It could be easier to scan as a list of the six verdict types, but no sentence is filler.

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

Completeness4/5

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

With no output schema, the description correctly compensates by naming the four returned fields (type, montant de l'écart, explication, écriture), and the read-only annotation covers the safety profile. It leaves open what happens when the discrepancy matches no category or when references are invalid, which is the main residual gap.

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%, so the schema already documents all four parameters, including the montant-vs-releve_id exclusivity. The description adds some business meaning by defining what an "avoir" is in this context and by tying the gap formula to montant/factures, but it does not explain the format or expectations of avoirs or how factures list should be constructed beyond the schema example.

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

Purpose4/5

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

Uses a specific verb ("Qualifie l'écart") on a specific resource (a payment vs. one or more invoices) and enumerates the full taxonomy of possible verdicts (aucun, paiement_partiel, trop_percu, escompte, avoir, double_paiement), so the agent knows precisely what class of output to expect. It does not name a sibling tool, so differentiation from rapprocher_paiement is only implied by the 'confirm a candidate' framing rather than stated.

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?

"À appeler pour confirmer un candidat dont l'écart n'est pas nul" gives a clear trigger condition that positions this as a follow-up diagnostic step rather than the matching action itself. It stops short of stating when not to call it (e.g. when the gap is zero, or before candidate matching has occurred).

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