Skip to main content
Glama

Define line items

well_define_line_items
Read-only

Read what this workspace has already billed, and flag which of the lines the user just described equal a past line. Use it before well_create_invoice_from_data, when the invoice's lines come from the user's words ("two days of consulting, and the hosting").

Never call it to add a product or a service to the catalog, or to change a product's price ("Ajoute le produit Audit SEO à 1 200 € HT", "Passe Audit SEO à 1 400 €"): those are well_create_product and well_update_product, and they bill nothing.

Pass lines: one entry per line the user described, each with a line_key (a fresh UUID you choose for that line and keep for the whole conversation, never its position in the list), its name, its sku when the user gave one, and its quantity and tax_rate when the user stated them ("3 days at 600" is quantity 3, unit_price 600; tax_rate is a percentage, 20 for 20%). Pass product_id for the exact live product selected by the skill from well_list_products, or for a product in this tool's catalogue whose SKU exactly equals the line's SKU. For a selected catalogue product, pass its unit_price explicitly when its currency is the invoice currency; a product id links the line but does not select or supply its price. A name never selects a catalogue product. Pass unit_price only for the resolved price of the line; never invent a figure. unit_price is in currency, the invoice's: a price the user stated in another currency ("50€ a day" on an AED invoice) is converted first with well_get_fx_quote (base the price's currency, quote the invoice currency, amount the unit price), and its converted_amount is passed as unit_price. Never leave such a price out unless the rate tool returns no_rate, never pass it unconverted, and never convert it yourself. Pass customer_id (the entity_id of the pre-selected or chosen customer) when you know the customer, so the lines already billed to them rank first, and customer_kind: "person" when that customer is a private individual. Pass currency (the invoice's ISO 4217 code, e.g. "EUR") when you know it, so only past lines billed in that currency come back and match: a price billed in another currency does not hold.

Returns items: the workspace's distinct past sales lines (one product billed in two currencies is two items), newest first (customer's own lines ahead of the rest), each with item_id, name, sku, product_id, unit_price, currency, tax_rate, times_billed (counted inside the recent window, not a lifetime total), last_billed and billed_to_customer. Returns matches: one entry per sent line, matched_on "sku" or "name" with the item_id of the past line it equals, or both null when no past line equals it, plus requested: the quantity, unit_price and tax_rate you sent for that line, echoed unchanged (null for a figure you did not send). A catalogue line's product_id from well_list_products is checked against live products in this workspace and echoed unchanged. Returns catalogue: the live products whose SKU exactly matches a sent line's SKU, with each product_id, name, sku, unit_price, currency, supply_type and billing_interval. It is empty when no sent SKU matches. A name never selects a catalogue product. Returns totals: items_total, tax_total and grand_total of the lines in requested, computed by Well in currency (each line's total and tax held to the currency's minor units, a line with no quantity counted once, a line with no unit_price and an exact match at the matched past item's unit_price, a line with no tax_rate at the vat_default rate), or null when you passed no currency, a line still has no unit price, or a line has no known tax rate (none stated and a null vat_default.rate). needs_pick is true while a line still has no price: it equals no past line, or equals past lines billed at different prices. When it is false every line has its price and the person has nothing to pick. These are the figures to show the user. NEVER compute a total or a tax yourself, and never send one to a create tool: Well computes them from the lines. Well does not match on the other figures.

Returns customer_last_invoice when you passed customer_id: the newest invoice issued to that customer, company or private individual (never another customer's, never a credit note), with reference_number, issue_date, currency (null when that invoice carries none) and its lines (name, quantity, unit_price, tax_rate), or null when they have none. It is what the person means by "as usual", "the usual fee", "same as last time" or "comme la dernière fois" for this customer: take the line or the rate they refer to from it, name it with its date, and when it is null say this customer has no past invoice.

Returns vat_default: the VAT rate a line assumes when the user stated none, worked out by Well, with its basis (rate in percent, or null when no basis exists). In order: "last_invoice_to_customer" the rate of every line of the newest invoice the issuer sent this customer, named by source_invoice (reference_number, issue_date); "domestic" the issuer's own country's standard rate for a customer in the same country; "intra_eu_reverse_charge" or "intra_eu_no_vat_id" a customer in another EU country, 0; "export" a customer outside the EU, 0; "workspace_default" the workspace's default VAT rate; "issuer_country_standard" the issuer country's standard rate, for a customer whose country is not known yet (a new customer, or none named yet); "unknown" no basis, rate null. The card shows that rate on every line that has none stated, ready to edit. NEVER ask the user for a VAT rate and never type one yourself: pass tax_rate only when the user stated one in their own words, or referred to the rate of their last invoice to this customer ("TVA comme la dernière fois"), which is the tax_rate of customer_last_invoice. A stated rate wins over vat_default. Say the assumed rate and its basis to the user in one line, so one word corrects it.

When the lines belong to a draft already saved (the person changes its lines, quantities or currency), pass its invoice_id and, on each line that is already on the draft, its line_id from the lines of the last invoice answer. Then a figure you did not send is the draft's saved one: requested carries the saved quantity, unit price and tax rate, and when currency differs from the draft's currency the saved prices come converted by Well at the rate of the issue date, with fx_conversion (from_currency, to_currency, rate, rate_display, rate_date, source) naming the rate; show rate_display, the rate with no padding zeros. In Well's chat a call without invoice_id reads the newest draft this conversation created for the same customer the same way. draft_invoice_id names the draft the figures came from, and each match of a saved line carries its line_id. NEVER ask the person for a price the draft already holds, in any currency, and never convert a price yourself. In Well's chat, write the answered lines to the draft with well_update_invoice and its line_items, never a delete and a new create.

A match is exact equality only: the same sku, or the same name once case and spacing are ignored. A null is not proof the line is new. Read items and judge whether a near name is the same thing. Only invoices this workspace issued or was paid for are read, never drafts, canceled invoices or invoices it received. Past invoice prices are historical candidates; the skill decides whether one applies to this line.

When the token authorizes one workspace, call this directly — no workspace call is needed first. When it authorizes several, this read will not guess which one you mean: pass workspace_id on the call.

Input Schema

NameRequiredDescriptionDefault
limitNoMax past items returned (default 50).
linesNoThe lines to check against the history.
currencyNoThe invoice's ISO 4217 currency. Only past lines in it come back and match.
invoice_idNoThe saved draft these lines belong to. Its saved figures fill what you did not send.
customer_idNoThe customer's entity_id. Their past lines rank first.
workspace_idNoTarget workspace. Omit when the token authorizes one workspace. Required when it authorizes several: this read reports one workspace's own figures and will not choose which.
customer_kindNoThe customer's `customer_kind` from well_list_customers: "person" for a private individual. Left out, customer_id names a company.
conversation_idNoThe conversation id returned by the previous Well result, in its meta under well/conversation_id, in its structuredContent, or in its JSON text block. Pass it back on every call in the same conversation, including a call a card makes, so the chosen workspace and the earlier answers still apply. It decides the conversation on its own: nothing the host states about the session replaces it. Omit it only on the first call of a conversation.
workspace_scopeNoRestrict this call to the family: the token's primary workspace plus the company workspaces under it that you are a member of. Unrelated authorized workspaces drop out of the read; row reads merge across the family, while a per-workspace figure still reports exactly one workspace.

Output Schema

NameRequiredDescriptionDefault
errorNo
itemsYes
totalsNo
matchesYes
successYes
catalogueYes
needs_pickNo
vat_defaultNo
error_reasonNo
fx_conversionNo
conversation_idNoThe conversation this result belongs to. Pass it back as the conversation_id argument on every later Well call in the same conversation.
newly_connectedNoTools that connected to this workspace since the last result and that no session was told about yet, oldest first. Present only when at least one tool is new. The connected-line rule says when to tell an entry; when it does, one line per entry, in the person's language: "<name> is connected.". Never fold several entries into one sentence. Each entry comes back once, on one result only: never repeat its line later.
draft_invoice_idNo
resolved_workspaceNoThe workspace that answered, when the caller named none and the token authorizes several.
conversation_id_noteNoPresent only when the server opened a fresh lane, stating that no choice recorded earlier was read.
customer_last_invoiceNo
conversation_id_sourceNoWhere the conversation id came from: the host's own request meta, the caller's argument, or a fresh lane the server opened.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed26 schema fields changed
    • removedOutput schema / properties / catalogue / items / properties / billing_interval / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / catalogue / items / properties / billing_interval / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • removedOutput schema / properties / catalogue / items / properties / currency / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / catalogue / items / properties / currency / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • removedOutput schema / properties / catalogue / items / properties / unit_price / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / catalogue / items / properties / unit_price / type
      Added value: +[
      +  "number",
      +  "null"
      +]
    • changedOutput schema / properties / customer_last_invoice / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "currency": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ]
      -      },
      -      "invoice_id": {
      -        "type": "string"
      -      },
      -      "issue_date": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ]
      -      },
      -      "lines": {
      -        "items": {
      -          "additionalProperties": false,
      -          "properties": {
      -            "name": {
      -              "type": "string"
      -            },
      -            "quantity": {
      -              "anyOf": [
      -                {
      -                  "type": "number"
      -                },
      -                {
      -                  "type": "null"
      -                }
      -              ]
      -            },
      -            "tax_rate": {
      -              "anyOf": [
      -                {
      -                  "type": "number"
      -                },
      -                {
      -                  "type": "null"
      -                }
      -              ]
      -            },
      -            "unit_price": {
      -              "anyOf": [
      -                {
      -                  "type": "number"
      -                },
      -                {
      -                  "type": "null"
      -                }
      -              ]
      -            }
      -          },
      -          "required": [
      -            "name",
      -            "quantity",
      -            "unit_price",
      -            "tax_rate"
      -          ],
      -          "type": "object"
      -        },
      -        "type": "array"
      -      },
      -      "reference_number": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ]
      -      }
      -    },
      -    "required": [
      -      "invoice_id",
      -      "reference_number",
      -      "issue_date",
      -      "currency",
      -      "lines"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "currency": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "invoice_id": {
      +        "type": "string"
      +      },
      +      "issue_date": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "lines": {
      +        "items": {
      +          "additionalProperties": false,
      +          "properties": {
      +            "name": {
      +              "type": "string"
      +            },
      +            "quantity": {
      +              "type": [
      +                "number",
      +                "null"
      +              ]
      +            },
      +            "tax_rate": {
      +              "type": [
      +                "number",
      +                "null"
      +              ]
      +            },
      +            "unit_price": {
      +              "type": [
      +                "number",
      +                "null"
      +              ]
      +            }
      +          },
      +          "required": [
      +            "name",
      +            "quantity",
      +            "unit_price",
      +            "tax_rate"
      +          ],
      +          "type": "object"
      +        },
      +        "type": "array"
      +      },
      +      "reference_number": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      }
      +    },
      +    "required": [
      +      "invoice_id",
      +      "reference_number",
      +      "issue_date",
      +      "currency",
      +      "lines"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • removedOutput schema / properties / items / items / properties / last_billed / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / items / items / properties / last_billed / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • removedOutput schema / properties / items / items / properties / sku / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / items / items / properties / sku / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • removedOutput schema / properties / items / items / properties / tax_rate / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / items / items / properties / tax_rate / type
      Added value: +[
      +  "number",
      +  "null"
      +]
    • removedOutput schema / properties / items / items / properties / unit_price / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / items / items / properties / unit_price / type
      Added value: +[
      +  "number",
      +  "null"
      +]
    • removedOutput schema / properties / matches / items / properties / item_id / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / matches / items / properties / item_id / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • removedOutput schema / properties / matches / items / properties / requested / properties / quantity / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / matches / items / properties / requested / properties / quantity / type
      Added value: +[
      +  "number",
      +  "null"
      +]
    • removedOutput schema / properties / matches / items / properties / requested / properties / tax_rate / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / matches / items / properties / requested / properties / tax_rate / type
      Added value: +[
      +  "number",
      +  "null"
      +]
    • removedOutput schema / properties / matches / items / properties / requested / properties / unit_price / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / matches / items / properties / requested / properties / unit_price / type
      Added value: +[
      +  "number",
      +  "null"
      +]
    • removedOutput schema / properties / resolved_workspace / properties / name / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / resolved_workspace / properties / name / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • changedOutput schema / properties / vat_default / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "basis": {
      -        "enum": [
      -          "domestic",
      -          "intra_eu_reverse_charge",
      -          "intra_eu_no_vat_id",
      -          "export",
      -          "last_invoice_to_customer",
      -          "workspace_default",
      -          "issuer_country_standard",
      -          "unknown"
      -        ],
      -        "type": "string"
      -      },
      -      "customer_country": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ]
      -      },
      -      "issuer_country": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ]
      -      },
      -      "rate": {
      -        "anyOf": [
      -          {
      -            "type": "number"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ]
      -      },
      -      "source_invoice": {
      -        "anyOf": [
      -          {
      -            "additionalProperties": false,
      -            "properties": {
      -              "invoice_id": {
      -                "type": "string"
      -              },
      -              "issue_date": {
      -                "anyOf": [
      -                  {
      -                    "type": "string"
      -                  },
      -                  {
      -                    "type": "null"
      -                  }
      -                ]
      -              },
      -              "reference_number": {
      -                "anyOf": [
      -                  {
      -                    "type": "string"
      -                  },
      -                  {
      -                    "type": "null"
      -                  }
      -                ]
      -              }
      -            },
      -            "required": [
      -              "invoice_id",
      -              "reference_number",
      -              "issue_date"
      -            ],
      -            "type": "object"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ]
      -      }
      -    },
      -    "required": [
      -      "rate",
      -      "basis",
      -      "issuer_country",
      -      "customer_country"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "basis": {
      +        "enum": [
      +          "domestic",
      +          "intra_eu_reverse_charge",
      +          "intra_eu_no_vat_id",
      +          "export",
      +          "last_invoice_to_customer",
      +          "workspace_default",
      +          "issuer_country_standard",
      +          "unknown"
      +        ],
      +        "type": "string"
      +      },
      +      "customer_country": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "issuer_country": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "rate": {
      +        "type": [
      +          "number",
      +          "null"
      +        ]
      +      },
      +      "source_invoice": {
      +        "anyOf": [
      +          {
      +            "additionalProperties": false,
      +            "properties": {
      +              "invoice_id": {
      +                "type": "string"
      +              },
      +              "issue_date": {
      +                "type": [
      +                  "string",
      +                  "null"
      +                ]
      +              },
      +              "reference_number": {
      +                "type": [
      +                  "string",
      +                  "null"
      +                ]
      +              }
      +            },
      +            "required": [
      +              "invoice_id",
      +              "reference_number",
      +              "issue_date"
      +            ],
      +            "type": "object"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ]
      +      }
      +    },
      +    "required": [
      +      "rate",
      +      "basis",
      +      "issuer_country",
      +      "customer_country"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
  2. Changed2 schema fields changed
    • addedOutput schema / properties / fx_conversion / properties / rate_display
      Added value: +{
      +  "type": "string"
      +}
    • changedOutput schema / properties / fx_conversion / required
      Previous value: -[
      -  "from_currency",
      -  "to_currency",
      -  "rate",
      -  "rate_date",
      -  "source"
      -]New value: +[
      +  "from_currency",
      +  "to_currency",
      +  "rate",
      +  "rate_display",
      +  "rate_date",
      +  "source"
      +]
  3. Changed13 schema fields changed
    • addedInput schema / properties / customer_kind
      Added value: +{
      +  "description": "The customer's `customer_kind` from well_list_customers: \"person\" for a private individual. Left out, customer_id names a company.",
      +  "enum": [
      +    "company",
      +    "person"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / lines / items / properties / product_id
      Added value: +{
      +  "description": "The live catalogue product's product_id from well_list_products, if this line is that product.",
      +  "format": "uuid",
      +  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
      +  "type": "string"
      +}
    • changedInput schema / properties / lines / items / properties / unit_price / description
      Previous value: -"The unit price the user stated, in `currency`: a price stated in another currency is passed as well_get_fx_quote's converted_amount. Leave out when they gave none."New value: +"The resolved unit price for this invoice line, in `currency`. The skill selects the source; convert a user-stated price from another currency with well_get_fx_quote."
    • addedOutput schema / properties / catalogue
      Added value: +{
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "billing_interval": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ]
      +      },
      +      "currency": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ]
      +      },
      +      "name": {
      +        "type": "string"
      +      },
      +      "product_id": {
      +        "format": "uuid",
      +        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
      +        "type": "string"
      +      },
      +      "sku": {
      +        "type": "string"
      +      },
      +      "supply_type": {
      +        "type": "string"
      +      },
      +      "unit_price": {
      +        "anyOf": [
      +          {
      +            "type": "number"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ]
      +      }
      +    },
      +    "required": [
      +      "product_id",
      +      "name",
      +      "sku",
      +      "unit_price",
      +      "currency",
      +      "supply_type",
      +      "billing_interval"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / customer_last_invoice
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": false,
      +      "properties": {
      +        "currency": {
      +          "anyOf": [
      +            {
      +              "type": "string"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ]
      +        },
      +        "invoice_id": {
      +          "type": "string"
      +        },
      +        "issue_date": {
      +          "anyOf": [
      +            {
      +              "type": "string"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ]
      +        },
      +        "lines": {
      +          "items": {
      +            "additionalProperties": false,
      +            "properties": {
      +              "name": {
      +                "type": "string"
      +              },
      +              "quantity": {
      +                "anyOf": [
      +                  {
      +                    "type": "number"
      +                  },
      +                  {
      +                    "type": "null"
      +                  }
      +                ]
      +              },
      +              "tax_rate": {
      +                "anyOf": [
      +                  {
      +                    "type": "number"
      +                  },
      +                  {
      +                    "type": "null"
      +                  }
      +                ]
      +              },
      +              "unit_price": {
      +                "anyOf": [
      +                  {
      +                    "type": "number"
      +                  },
      +                  {
      +                    "type": "null"
      +                  }
      +                ]
      +              }
      +            },
      +            "required": [
      +              "name",
      +              "quantity",
      +              "unit_price",
      +              "tax_rate"
      +            ],
      +            "type": "object"
      +          },
      +          "type": "array"
      +        },
      +        "reference_number": {
      +          "anyOf": [
      +            {
      +              "type": "string"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ]
      +        }
      +      },
      +      "required": [
      +        "invoice_id",
      +        "reference_number",
      +        "issue_date",
      +        "currency",
      +        "lines"
      +      ],
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ]
      +}
    • changedOutput schema / properties / error_reason / enum
      Previous value: -[
      -  "no_workspace",
      -  "no_own_company",
      -  "customer_not_found",
      -  "duplicate_line_key",
      -  "draft_not_found",
      -  "read_failed"
      -]New value: +[
      +  "no_workspace",
      +  "no_own_company",
      +  "customer_not_found",
      +  "duplicate_line_key",
      +  "draft_not_found",
      +  "product_not_found",
      +  "read_failed"
      +]
    • addedOutput schema / properties / items / items / properties / product_id
      Added value: +{
      +  "anyOf": [
      +    {
      +      "format": "uuid",
      +      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ]
      +}
    • changedOutput schema / properties / items / items / required
      Previous value: -[
      -  "item_id",
      -  "name",
      -  "sku",
      -  "unit_price",
      -  "currency",
      -  "tax_rate",
      -  "times_billed",
      -  "last_billed",
      -  "billed_to_customer"
      -]New value: +[
      +  "item_id",
      +  "name",
      +  "sku",
      +  "product_id",
      +  "unit_price",
      +  "currency",
      +  "tax_rate",
      +  "times_billed",
      +  "last_billed",
      +  "billed_to_customer"
      +]
    • addedOutput schema / properties / matches / items / properties / product_id
      Added value: +{
      +  "anyOf": [
      +    {
      +      "format": "uuid",
      +      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ]
      +}
    • changedOutput schema / properties / matches / items / required
      Previous value: -[
      -  "line_key",
      -  "matched_on",
      -  "item_id",
      -  "requested"
      -]New value: +[
      +  "line_key",
      +  "matched_on",
      +  "item_id",
      +  "product_id",
      +  "requested"
      +]
    • addedOutput schema / properties / needs_pick
      Added value: +{
      +  "type": "boolean"
      +}
    • changedOutput schema / properties / vat_default / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "basis": {
      -        "enum": [
      -          "domestic",
      -          "intra_eu_reverse_charge",
      -          "intra_eu_no_vat_id",
      -          "export",
      -          "unknown"
      -        ],
      -        "type": "string"
      -      },
      -      "customer_country": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ]
      -      },
      -      "issuer_country": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ]
      -      },
      -      "rate": {
      -        "anyOf": [
      -          {
      -            "type": "number"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ]
      -      }
      -    },
      -    "required": [
      -      "rate",
      -      "basis",
      -      "issuer_country",
      -      "customer_country"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "basis": {
      +        "enum": [
      +          "domestic",
      +          "intra_eu_reverse_charge",
      +          "intra_eu_no_vat_id",
      +          "export",
      +          "last_invoice_to_customer",
      +          "workspace_default",
      +          "issuer_country_standard",
      +          "unknown"
      +        ],
      +        "type": "string"
      +      },
      +      "customer_country": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ]
      +      },
      +      "issuer_country": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ]
      +      },
      +      "rate": {
      +        "anyOf": [
      +          {
      +            "type": "number"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ]
      +      },
      +      "source_invoice": {
      +        "anyOf": [
      +          {
      +            "additionalProperties": false,
      +            "properties": {
      +              "invoice_id": {
      +                "type": "string"
      +              },
      +              "issue_date": {
      +                "anyOf": [
      +                  {
      +                    "type": "string"
      +                  },
      +                  {
      +                    "type": "null"
      +                  }
      +                ]
      +              },
      +              "reference_number": {
      +                "anyOf": [
      +                  {
      +                    "type": "string"
      +                  },
      +                  {
      +                    "type": "null"
      +                  }
      +                ]
      +              }
      +            },
      +            "required": [
      +              "invoice_id",
      +              "reference_number",
      +              "issue_date"
      +            ],
      +            "type": "object"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ]
      +      }
      +    },
      +    "required": [
      +      "rate",
      +      "basis",
      +      "issuer_country",
      +      "customer_country"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedOutput schema / required
      Previous value: -[
      -  "items",
      -  "matches",
      -  "success"
      -]New value: +[
      +  "items",
      +  "matches",
      +  "catalogue",
      +  "success"
      +]
  4. Changed1 schema field changed
    • changedOutput schema / properties / newly_connected / description
      Previous value: -"Tools that connected to this workspace since the last result and that no session was told about yet, oldest first. Present only when at least one tool is new. Start the reply with one line per entry, in the person's language: \"<name> is connected.\". Never fold several entries into one sentence. Each entry comes back once, on one result only: never repeat its line later."New value: +"Tools that connected to this workspace since the last result and that no session was told about yet, oldest first. Present only when at least one tool is new. The connected-line rule says when to tell an entry; when it does, one line per entry, in the person's language: \"<name> is connected.\". Never fold several entries into one sentence. Each entry comes back once, on one result only: never repeat its line later."
  5. Changed2 schema fields changed
    • addedInput schema / properties / workspace_scope
      Added value: +{
      +  "description": "Restrict this call to the family: the token's primary workspace plus the company workspaces under it that you are a member of. Unrelated authorized workspaces drop out of the read; row reads merge across the family, while a per-workspace figure still reports exactly one workspace.",
      +  "enum": [
      +    "family"
      +  ],
      +  "type": "string"
      +}
    • addedOutput schema / properties / totals
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": false,
      +      "properties": {
      +        "grand_total": {
      +          "type": "number"
      +        },
      +        "items_total": {
      +          "type": "number"
      +        },
      +        "tax_total": {
      +          "type": "number"
      +        }
      +      },
      +      "required": [
      +        "items_total",
      +        "tax_total",
      +        "grand_total"
      +      ],
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ]
      +}
  6. Changed1 schema field changed
    • addedOutput schema / properties / newly_connected
      Added value: +{
      +  "description": "Tools that connected to this workspace since the last result and that no session was told about yet, oldest first. Present only when at least one tool is new. Start the reply with one line per entry, in the person's language: \"<name> is connected.\". Never fold several entries into one sentence. Each entry comes back once, on one result only: never repeat its line later.",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "name": {
      +        "type": "string"
      +      },
      +      "service_id": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "name",
      +      "service_id"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
  7. Added

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true and non-destructive, and the description adds substantially more: what history is excluded (drafts, canceled, received invoices), how matching works (exact sku or case/space-insensitive name, null is not proof of newness), that a customer's lines rank first, and that this tool never writes – a separate well_update_invoice call is required. The read-only contract is reinforced rather than contradicted.

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

Conciseness3/5

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

The opening two sentences are well front-loaded, but the body runs to well over a thousand words of dense run-on paragraphs mixing matching rules, FX handling, VAT derivation, draft behavior and return-field walkthroughs. There is real redundancy ('A name never selects a catalogue product' appears twice, repeated conversion prohibitions), which hurts scanability even though most content is substantive.

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 9-parameter tool whose output schema exists, the description covers the non-obvious gaps an agent would otherwise trip on: needs_pick vs totals being null, why totals can be null, vat_default basis ordering, customer_last_invoice for 'as usual' phrasing, and the multi-workspace requirement. Nothing an agent needs to call it correctly is missing.

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

Parameters5/5

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

Schema coverage is already 100%, but the description adds genuine meaning beyond it: line_key must be a stable UUID never a list position, product_id must come from well_list_products or an exact-SKU catalogue hit and a name never selects a product, unit_price must be converted via well_get_fx_quote rather than computed, and invoice_id/line_id semantics for editing a saved draft. This is well above the baseline-3 case for full schema coverage.

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+resource ('Read what this workspace has already billed, and flag which of the lines the user just described equal a past line') and immediately distinguishes scope from siblings. It names well_create_invoice_from_data as the downstream consumer and explicitly rules out well_create_product/well_update_product, so an agent can place it in the workflow without opening any schema.

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

Usage Guidelines5/5

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

Explicit when-to-use ('before `well_create_invoice_from_data`, when the invoice's lines come from the user's words') plus explicit when-not with verbatim example utterances that belong to other tools. It also states prerequisites (workspace_id when the token authorizes several) and the draft-refresh case, leaving nothing to inference.

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