Skip to main content
Glama

Declare a counterparty's default transaction category

well_set_counterparty_default_category

Declare what spend at ONE counterparty is — asked once about the counterparty, instead of once per transaction.

REQUIRED: company_id, from well_list_counterparties. category — a LABEL from the closed list this schema carries. The vocabulary is fixed: there is no free-text category and no way to mint one.

This is the counterparty's DEFAULT, not one row's category. Every transaction of this counterparty categorized from here on takes the label without a model call.

It also reaches backward. The counterparty's existing transactions are relabelled too, in the background over the minutes or hours after the call. Rows a person answered are never touched: a transaction someone categorized or confirmed by hand keeps what they gave it. Tell the user a declaration rewrites the counterparty's history, so they are not surprised by it. To change ONE row instead, use well_set_transaction_category, which sets that transaction and leaves the counterparty alone.

A declaration is trusted at once. The other way a counterparty gets a default is by being taught: three corrections to the same category on three distinct transactions. A declaration skips that, because the person has already said what the answer is.

It overrides whatever the counterparty carried before, including a category the system had inferred from corrections and one an earlier declaration already wrote onto these same rows. A later transaction-level correction still wins over the declaration on the row it names, and teaches the counterparty that the default is wrong.

Do not declare a default for a counterparty whose spend has more than one nature. A marketplace or a cloud vendor selling hardware, compute and advertising to the same buyer has no single answer, and a declaration would state one. Leave those to the classifier and correct them per line.

Not for the workspace's own company. A default is about the other party; the server refuses it on the own company.

The list depends on the workspace. A personal space files household categories, a company workspace business categories, and both file the shared ones. A label outside the workspace's list writes nothing and returns refusal_reason with allowed_categories: send a label from that list.

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
categoryYesThe category label spend at this counterparty defaults to. Must be one of the labels in this list.
company_idYesThe counterparty to declare a default for, from well_list_counterparties.
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.
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
successYes
categoryNoThe label the counterparty's default now carries.
company_idNo
company_nameNo
refusal_reasonNoSet when the category is not in this workspace's list. Nothing was written.
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.
allowed_categoriesNoWith refusal_reason: the categories this workspace files and is offered. Send `label` back; `name` is how the workspace shows it.
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. Changed3 schema fields changed
    • changedInput schema / properties / category / enum
      Previous value: -[
      -  "Subscription & product revenue",
      -  "Services & implementation revenue",
      -  "Grants & subsidies (non-repayable)",
      -  "Research tax credit (CIR/CICE)",
      -  "Other operating income & cashback",
      -  "Employee salaries (net)",
      -  "Employer social charges",
      -  "Wage withholding remittance (PAS)",
      -  "Employee benefits & insurance",
      -  "Recruiting & hiring fees",
      -  "Engineering / product contractors",
      -  "Operations / GTM / other contractors",
      -  "Legal & corporate-secretarial fees",
      -  "Accounting, finance & advisory fees",
      -  "Other professional & consulting fees",
      -  "AI model / inference (cost of revenue)",
      -  "Hosting, infrastructure & data (cost of revenue)",
      -  "Developer & engineering software",
      -  "Business & productivity software",
      -  "Hardware & equipment",
      -  "Advertising & paid media",
      -  "Sales / marketing tools & lead-gen",
      -  "AI creative & content production",
      -  "Office rent & coworking",
      -  "Office supplies & general operations",
      -  "Travel & transport",
      -  "Meals & entertainment",
      -  "Team events & offsites",
      -  "Bank, FX & payment-processing fees",
      -  "Business insurance",
      -  "Corporate income tax",
      -  "Local & business taxes",
      -  "Other operating expense (residual)",
      -  "VAT receivable (input / refund)",
      -  "VAT payable (output)",
      -  "Treasury placement (out)",
      -  "Treasury redemption (in)",
      -  "Investment & interest income",
      -  "Equity proceeds & raise costs",
      -  "Loan drawdowns & repayments",
      -  "Repayable public advances",
      -  "Realised FX gain / loss",
      -  "Inter-account transfer (same entity)",
      -  "Inter-company transfer (own entities)",
      -  "FX conversion principal",
      -  "Uncategorised / suspense"
      -]New value: +[
      +  "Subscription & product revenue",
      +  "Services & implementation revenue",
      +  "Grants & subsidies (non-repayable)",
      +  "Research tax credit (CIR/CICE)",
      +  "Other operating income & cashback",
      +  "Employee salaries (net)",
      +  "Employer social charges",
      +  "Wage withholding remittance (PAS)",
      +  "Employee benefits & insurance",
      +  "Recruiting & hiring fees",
      +  "Engineering / product contractors",
      +  "Operations / GTM / other contractors",
      +  "Legal & corporate-secretarial fees",
      +  "Accounting, finance & advisory fees",
      +  "Other professional & consulting fees",
      +  "AI model / inference (cost of revenue)",
      +  "Hosting, infrastructure & data (cost of revenue)",
      +  "Developer & engineering software",
      +  "Business & productivity software",
      +  "Hardware & equipment",
      +  "Advertising & paid media",
      +  "Sales / marketing tools & lead-gen",
      +  "AI creative & content production",
      +  "Office rent & coworking",
      +  "Office supplies & general operations",
      +  "Travel & transport",
      +  "Meals & entertainment",
      +  "Team events & offsites",
      +  "Bank, FX & payment-processing fees",
      +  "Business insurance",
      +  "Corporate income tax",
      +  "Local & business taxes",
      +  "Other operating expense (residual)",
      +  "VAT receivable (input / refund)",
      +  "VAT payable (output)",
      +  "Treasury placement (out)",
      +  "Treasury redemption (in)",
      +  "Investment & interest income",
      +  "Equity proceeds & raise costs",
      +  "Loan drawdowns & repayments",
      +  "Repayable public advances",
      +  "Realised FX gain / loss",
      +  "Inter-account transfer (same entity)",
      +  "Inter-company transfer (own entities)",
      +  "FX conversion principal",
      +  "Uncategorised / suspense",
      +  "Groceries",
      +  "Rent & mortgage",
      +  "Energy, water, internet & phone",
      +  "Health",
      +  "Personal insurance",
      +  "Shopping & clothing",
      +  "Leisure, culture & sport",
      +  "Subscriptions & streaming",
      +  "Childcare & education",
      +  "Gifts & donations",
      +  "Personal taxes",
      +  "Cash withdrawals",
      +  "Salary",
      +  "Other income",
      +  "Other household expenses"
      +]
    • addedOutput schema / properties / allowed_categories
      Added value: +{
      +  "description": "With refusal_reason: the categories this workspace files and is offered. Send `label` back; `name` is how the workspace shows it.",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "key": {
      +        "type": "string"
      +      },
      +      "label": {
      +        "type": "string"
      +      },
      +      "name": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "key",
      +      "label",
      +      "name"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / refusal_reason
      Added value: +{
      +  "const": "TRANSACTION_CATEGORY_OUTSIDE_WORKSPACE_AUDIENCE",
      +  "description": "Set when the category is not in this workspace's list. Nothing was written.",
      +  "type": "string"
      +}
  3. 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"
      +}
  4. 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"
      +}
  5. Added

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources