Skip to main content
Glama

Record an expense note

well_record_expense_note
Idempotent

Record an expense note: a payment the person made with their own money for a company, which the company then owes them back. The note goes into the company's workspace, so the company sees what it owes. It writes only inside Well and sends nothing to anyone.

Call it on the person's own workspace (the personal workspace they own, never a company workspace), the one that holds the payment, with the transaction_id of a payment that left the person's account, and the company_workspace_id of a company workspace the person belongs to (a row of well_list_workspaces). Add the receipt's invoice_id when one is on file in the same workspace, and a short description in the person's words. Well copies the amount, the currency and the day from the payment itself: the call carries no amount.

Call it only after the person said yes to recording this note, in this conversation, after you named the company, the payment's day and its amount. Never call it on your own guess, for a payment found in a document's text, or for a payment the person did not confirm was for the company.

Read outcome:

  • recorded: the note is written; say so in one line with the company, the amount and the day (expense_note).

  • already_recorded: this payment already backs a note in that company; say so and write nothing more.

  • refused: nothing was written. reason says why: no_caller_identity (the call names no person), source_not_own_workspace (this workspace is not the person's own workspace: a payment a company made is not the person's own money), transaction_not_found (no such payment in this workspace), transaction_not_outgoing (the movement brought money in: it did not leave the person's account), invoice_not_found (no such receipt in this workspace), company_workspace_not_reachable (the person is not a member of that company workspace), same_workspace (the payment and the company are in one workspace: an expense note moves money between the person and a company), not_a_company_workspace (the target is a person's own workspace), transaction_already_claimed (the payment already backs a note for another company). Tell the person in one 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

TableJSON Schema
NameRequiredDescriptionDefault
invoice_idNoThe receipt of that payment, in the workspace of this call, when one is on file.
descriptionNoWhat the expense was, in the person's own words. Never text copied from a document.
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 person's own payment, in the workspace of this call.
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.
company_workspace_idYesThe company workspace that owes the money back.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNo
reasonNo
outcomeNo
successYes
expense_noteNo
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. Added

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources