Skip to main content
Glama

Measure a category against its usual month

well_measure_category_trend
Read-only

Measure ONE spending category for one month against its usual month: the month total, the usual amount, and the difference. It draws no card.

Call it when the person asks how much they spent on one category in a month, or how a month compares to usual ("how much did I spend on groceries this month compared to usual?"). For several categories at once, or for a total by category, use well_sum_transactions instead.

"Usual" is the mean of the 3 full months before the month. A month with no row of the category counts 0. Read baseline_complete before you call the figure usual: when it is false, some of those months had no transaction in scope at all, so say which months had data (baseline_activity) and do not call the mean usual.

The month defaults to the running month in UTC. The running month is partial: month_complete is false, so say the month is not over. A month after the running month is refused.

Figures are per currency, with no conversion: one entry in currencies per currency, at most 10. Never add two currencies together. An empty currencies means the category has no row in the whole window. A month amount is the net of the category's money in and money out, as a magnitude: spend minus refunds on a feed that keeps one sign convention. When a large share of the category's rows over the window is negative and a large share is positive, the workspace pools a feed that signs its outflows with one that stores magnitudes, and no single spend figure exists: the call refuses with refusal_reason: "mixed_sign_conventions" and the two row counts, and measures nothing.

uncategorized_in_month.count is the rows of the month with no category at all; a row filed under a category the person typed is not counted. Some of them can belong to this category, so the month total is a floor when the count is not 0: say so. excluded_malformed counts the rows with an amount that could not be read.

The category list depends on the workspace. A personal space files household categories, a company workspace business categories, and both file the shared ones. A category outside the workspace's list returns refusal_reason and allowed_categories, and nothing is measured. A personal space shows some shared keys under its own name: TRAVEL_TRANSPORT ("Transport & travel"), MEALS_ENTERTAINMENT ("Restaurants & bars"), BANK_FX_PAYMENT_PROCESSING_FEES ("Bank fees"), TREASURY_PLACEMENT_OUT ("Savings & investments (out)"), TREASURY_REDEMPTION_IN ("Savings & investments (in)"), INVESTMENT_INTEREST_INCOME ("Interest"), LOAN_DRAWDOWNS_REPAYMENTS ("Loans & credit"), INTER_ACCOUNT_TRANSFER_SAME_ENTITY ("Transfers between my accounts"), FX_CONVERSION_PRINCIPAL ("Currency exchange"), UNCATEGORISED_SUSPENSE ("Uncategorised"). Name a category with category.label or category.names from the result, never with the key.

scope defaults to own: the workspace's own transactions. own_and_adopted adds the rows a parent workspace shared with it.

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
monthNoThe month to measure, `YYYY-MM`. Omit for the running month in UTC. A later month is refused.
scopeNo`own` (the default) for the workspace's own rows, `own_and_adopted` to add the rows a parent shared.
categoryYesThe catalog key of ONE category. A personal space names some shared keys differently: TRAVEL_TRANSPORT ("Transport & travel"), MEALS_ENTERTAINMENT ("Restaurants & bars"), BANK_FX_PAYMENT_PROCESSING_FEES ("Bank fees"), TREASURY_PLACEMENT_OUT ("Savings & investments (out)"), TREASURY_REDEMPTION_IN ("Savings & investments (in)"), INVESTMENT_INTEREST_INCOME ("Interest"), LOAN_DRAWDOWNS_REPAYMENTS ("Loans & credit"), INTER_ACCOUNT_TRANSFER_SAME_ENTITY ("Transfers between my accounts"), FX_CONVERSION_PRINCIPAL ("Currency exchange"), UNCATEGORISED_SUSPENSE ("Uncategorised").
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.
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
monthNo
scopeYes
windowNo
successYes
categoryNo
currenciesNo
month_completeNo
refusal_reasonNo
baseline_monthsNo
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.
month_boundariesNo
baseline_activityNo
baseline_completeNo
allowed_categoriesNoWith refusal_reason: the categories this workspace files and is offered. Send `label` back; `name` is how the workspace shows it.
excluded_malformedNo
resolved_workspaceNoThe workspace that answered, when the caller named none and the token authorizes several.
workspace_audienceNo
conversation_id_noteNoPresent only when the server opened a fresh lane, stating that no choice recorded earlier was read.
currencies_truncatedNo
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.
uncategorized_in_monthNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changed
    • removedOutput schema / properties / currencies / items / properties / currency / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / currencies / items / properties / currency / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • removedOutput schema / properties / currencies / items / properties / delta_percent / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / currencies / items / properties / delta_percent / 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"
      +]
  2. Changed1 schema field changed
    • changedInput schema / properties / category / enum
      Previous value: -[
      -  "SUBSCRIPTION_PRODUCT_REVENUE",
      -  "SERVICES_IMPLEMENTATION_REVENUE",
      -  "GRANTS_SUBSIDIES_NON_REPAYABLE",
      -  "RESEARCH_TAX_CREDIT",
      -  "OTHER_OPERATING_INCOME_CASHBACK",
      -  "EMPLOYEE_SALARIES_NET",
      -  "EMPLOYER_SOCIAL_CHARGES",
      -  "WAGE_WITHHOLDING_REMITTANCE",
      -  "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",
      -  "VAT_PAYABLE",
      -  "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",
      -  "HOME_ENERGY_WATER_TELECOM",
      -  "HEALTH_CARE",
      -  "PERSONAL_INSURANCE",
      -  "SHOPPING_CLOTHING",
      -  "LEISURE_CULTURE_SPORT",
      -  "SUBSCRIPTIONS_STREAMING",
      -  "CHILDCARE_EDUCATION",
      -  "GIFTS_DONATIONS",
      -  "PERSONAL_TAXES",
      -  "CASH_WITHDRAWALS",
      -  "SALARY_INCOME",
      -  "OTHER_PERSONAL_INCOME",
      -  "OTHER_HOUSEHOLD_EXPENSES"
      -]New value: +[
      +  "SUBSCRIPTION_PRODUCT_REVENUE",
      +  "SERVICES_IMPLEMENTATION_REVENUE",
      +  "GRANTS_SUBSIDIES_NON_REPAYABLE",
      +  "RESEARCH_TAX_CREDIT",
      +  "OTHER_OPERATING_INCOME_CASHBACK",
      +  "EMPLOYEE_SALARIES_NET",
      +  "EMPLOYER_SOCIAL_CHARGES",
      +  "WAGE_WITHHOLDING_REMITTANCE",
      +  "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",
      +  "VAT_PAYABLE",
      +  "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",
      +  "GOODS_PURCHASED",
      +  "BANKING_SERVICES",
      +  "GROCERIES",
      +  "RENT_MORTGAGE",
      +  "HOME_ENERGY_WATER_TELECOM",
      +  "HEALTH_CARE",
      +  "PERSONAL_INSURANCE",
      +  "SHOPPING_CLOTHING",
      +  "LEISURE_CULTURE_SPORT",
      +  "SUBSCRIPTIONS_STREAMING",
      +  "CHILDCARE_EDUCATION",
      +  "GIFTS_DONATIONS",
      +  "PERSONAL_TAXES",
      +  "CASH_WITHDRAWALS",
      +  "SALARY_INCOME",
      +  "OTHER_PERSONAL_INCOME",
      +  "OTHER_HOUSEHOLD_EXPENSES"
      +]
  3. 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."
  4. Added

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the annotations (readOnly, non-destructive, closed-world) it discloses substantial behavior: the 'usual' = mean of the 3 prior full months, zero-counting, partial running month, per-currency with no conversion, net-of-refunds semantics, and an explicit refusal path with `refusal_reason: "mixed_sign_conventions"` plus row counts. It also discloses the floor caveat via `uncategorized_in_month.count` and `excluded_malformed`.

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?

It is front-loaded with purpose and alternative routing before edge-case detail, which suits the genuinely complex measurement semantics. However, it is dense and repeats the lengthy personal-space category-label mapping verbatim from the schema, a chunk that does not earn its place twice.

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 financial read with an output schema, it covers everything an agent needs: defaulting, workspace resolution, currency non-additivity, refusal behavior, completeness flags, and scope semantics. The return values are explained where they drive interpretation (`baseline_complete`, `month_complete`) without over-documenting the schema.

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 description coverage is 100%, so the baseline is 3. The description largely restates what the schema already documents (scope default `own`, month default, category naming, workspace_id requirement), including a near-verbatim copy of the personal-space key-to-label mapping that already lives in the `category` schema description; it adds little net meaning beyond the structured fields.

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?

It opens with a specific verb+resource+scope: 'Measure ONE spending category for one month against its usual month', and immediately enumerates the three outputs (month total, usual amount, difference). It explicitly contrasts with `well_sum_transactions` for multi-category or total-by-category cases, so the agent can discriminate against the nearest sibling without opening schemas.

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?

It states a concrete trigger ('when the person asks how much they spent on one category in a month') and names the alternative with its selection condition. It also gives pre-call conditions (read `baseline_complete` before calling the figure usual; a future month is refused) and operational rules for single- vs multi-workspace tokens.

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