Skip to main content
Glama

Get cost structure

well_get_cost_structure
Read-only

Get the workspace's cost structure: outflow for the latest closed month, broken down by category — the exact same computation and numbers the Well app's canvas cost-structure donut chart shows. Use this instead of summing/grouping transactions yourself.

Returns entries (an array of { category, amount, pct }, sorted by amount descending) and currency (the workspace base currency). amount is a magnitude (outflow), not signed.

period_start and period_end are the inclusive YYYY-MM-DD bounds these amounts cover — always a single month. Read the period from those fields and state it whenever you present the numbers. Never derive it from today's date. Never present the figures as a quarter or a multi-month span. If both fields are absent, say the period is unknown rather than naming one.

rung names which grouping actually produced these categories — "ledger_account" (the workspace's own chart of accounts), "category_normalized" (Well's auto-categorization), "transaction_type" (a technical fallback bucket), or "uncategorised" (no rung qualified — either nothing covered the month, or a rung had the coverage but too few labelled rows). State it when you present the breakdown so the user knows whether they're looking at their own ledger's categories or Well's.

label_provenance says whether a human owns those labels, which rung cannot — "curated" (a person set or confirmed every one), "machine" (none were confirmed by a person), "mixed" (some of each), or "unlabelled" (the breakdown is not grouped on a category, so the question does not apply). When it is "machine" or "mixed", say the categories were assigned automatically and may be wrong on any individual line, rather than presenting them as the user's own categorization.

If hints are present (e.g. a coverage caveat about uncategorized spend), disclose them rather than presenting the breakdown as unconditionally complete.

Pass year + month to break down a specific past month instead of the latest closed one. Read the month you actually got from period_start/period_end either way — a requested month with no data still comes back with whatever the endpoint could cover.

When the token authorizes one workspace, call this directly — no other tool 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
yearNoCalendar year of the reporting period, e.g. 2026. Must be given together with `month`.
monthNoCalendar month of the reporting period, 1 = January … 12 = December. Must be given together with `year`. Omit both to read the live/current figure.
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.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
rungNoWhich ladder rung produced these categories: the workspace's own ledger accounts, Well's auto-categorization, a technical fallback bucket, or none qualified.
errorNo
hintsNo
entriesYes
successYes
currencyNo
period_endNoInclusive YYYY-MM-DD end of that window.
records_urlNoLogin-gated deep link to the web-app transactions table, so the user can categorize the underlying spend. Null when no workspace is in context.
period_startNoInclusive YYYY-MM-DD start of the window the amounts cover (the latest closed month).
label_provenanceNoWhether a human owns the labels: every one set or confirmed by a person (curated), none confirmed (machine), some of each (mixed), or not grouped on a category at all (unlabelled).
resolved_workspaceNoThe workspace that answered, when the caller named none and the token authorizes several.

TDQS

A5/5.0
Behavior5/5

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

The description goes far beyond the readOnlyHint annotation by explaining the exact computation, the meaning of rung and label_provenance, the single-month period semantics, and the requirement to disclose hints. It also specifies how to handle missing period fields and machine-assigned labels, which an agent could not infer from annotations alone.

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

Conciseness5/5

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

The description is long but every sentence carries operational value; the core purpose and output are front-loaded, followed by caveats in a logical order. No filler, redundant restatements, or vague wording is present.

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?

Given that an output schema exists and annotations cover safety, the description adds all remaining operational context: return field meaning, period constraints, grouping provenance, label ownership, and multi-workspace handling. An agent has everything needed to invoke the tool correctly and present results accurately.

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?

Even though the schema already describes year, month, and workspace_id at 100 percent coverage, the description adds important runtime behavior: what happens when no data exists for a requested month, how the rung and label_provenance affect interpretation, and why workspace_id is required in multi-workspace contexts. This extra meaning is directly actionable.

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?

The description names a specific resource (the workspace cost structure) and a specific computation: outflow for the latest closed month broken down by category, matching the Well canvas donut chart. It also signals the tool's scope by saying to use it instead of manually summing transactions, which separates it from generic query tools.

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 explicitly tells the agent when to call this tool directly and when to add workspace_id for multi-workspace tokens, and it gives the year+month path for past months. It also warns to treat the returned period as authoritative and to avoid naming a period when the fields are absent, which is clear behavioral guidance.

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.

TDQS

A4.5/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: CRUD for companies, people, and invoices; financial analytics (cash, cost, runway, holdings); connector management and invocation; schema discovery; querying; reconciliation; and contact channel management. No two tools could be confused for the same action.

Naming Consistency5/5

All tools follow the `well_verb_noun` pattern with consistent verb choices (create, get, list, update, delete, add, remove, run, resolve, query, invoke). The naming is predictable and makes the tool's purpose immediately clear.

Tool Count4/5

With 26 tools, the set is slightly above the ideal 3-15 range, but every tool earns its place given the breadth of the domain (CRM, invoicing, financial analytics, reconciliation, connector management). The count is well-scoped and not excessive.

Completeness4/5

The tool surface covers core CRUD, financial KPIs, reconciliation, and connector management. Minor gaps exist (e.g., no direct tool to update contact channels or manage accounts), but the query and schema tools allow agents to work around them, and the primary workflows are fully supported.

Resources