Skip to main content
Glama

Attach a receipt to a payment

well_link_receipt_to_transaction
Idempotent

Attach a stored receipt to the payment the member picked from well_list_receipt_candidates. Well records the pick as a confirmed match, decided by a person, and puts the receipt on that payment. A later automatic match never replaces it.

Call it only after the member answered the numbered list with the number of a payment, with the document_id of that list and the picked payment's transaction_id. The member's answer is the consent: do not ask again. Never call it on your own guess, and never for the last choice (none of them).

Read outcome:

  • linked: confirm in one line with the payment's date, payee (transaction.label) and amount (for example « Reçu rattaché au paiement du 03/10 (Le Comptoir, 42,50 €). »). transaction.amount is signed: an outflow is negative. Say it without the minus sign.

  • already_linked: the receipt was already on this payment; say so.

  • ask_document_kind: Well read no receipt or invoice in this document; ask what it is (a receipt, a supplier invoice, or something else).

  • refused: nothing was written. reason says why: transaction_not_found (no such payment here), transaction_has_other_document (that payment already holds another document, which Well never replaces), over_allocated (the receipt or the payment is already settled), invalid (Well cannot match this pair), settled_by_other_invoice (another invoice already settles that payment), wrong_direction (that payment moves the wrong way for this receipt), not_offered (that payment is not one the list offers for this receipt now: offer the list again), receipt_linked_elsewhere (the receipt already sits on another payment: say it is already attached to a payment, and do not offer the list again), document_not_read (Well is still reading the document: say you will try again in a moment). Tell the member in one line. Offer the list again for every reason except receipt_linked_elsewhere and document_not_read.

It writes only inside Well.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
document_idYesThe stored document of the receipt, as `well_list_receipt_candidates` read it.
workspace_idNoTarget workspace. Omit when the token authorizes one workspace. Required when it authorizes several — a write lands in exactly one workspace and this call would not say which.
transaction_idYesThe payment the member picked by its number.
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.
idempotency_keyNoOptional client-supplied key. A retried write with the same key returns the original result instead of re-applying the operation.
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

TableJSON Schema
NameRequiredDescriptionDefault
errorNo
reasonNo
outcomeNo
receiptNo
successYes
document_idNo
transactionNo
transaction_idNo
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.
conversation_id_noteNoPresent only when the server opened a fresh lane, stating that no choice recorded earlier was read.
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. 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."
  2. Changed1 schema field 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"
      +}
  3. 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"
      +}
  4. Added

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources