Skip to main content
Glama

Compute figures

well_get_computed_figures
Read-only

Call this for any sum, difference, product, ratio, comparison, ranking or count of days over money, quantities or dates: never compute one yourself, because Well computes with exact decimals and your own arithmetic drifts.

Every operand is an input or earlier-step name. Every amount is a quoted decimal string, never a JSON number. Example: {"inputs":[{"name":"a","label":"A","amount":"1","currency":"GBP"},{"name":"b","label":"B","amount":"2","currency":"GBP"}],"steps":[{"id":"total","op":"sum","args":["a","b"]}]}. Label constants (0, 1, rates) as inputs.

take_until_total_reaches: args: [target], order (latest_due_first/largest_first), items naming amount and date inputs. sum_picked: per_item for every pick item exactly once, keyed by amount input name; sums picked items only.

div and round require places (0-12) and rounding: half_up, half_even or down. compare requires relation.

A total that Well measures (spend, invoices, receivables, payslips) comes from its well_sum_* tool. This tool only combines figures already read, and it never reads data.

sum/sub/min/max/compare/take_until_total_reaches: one currency throughout or none. sum_picked: the per_item values share one currency, or none. mul: at most one currency. div: currency over untagged amount keeps currency; equal currencies give an untagged ratio.

invalid_program: bad program. duplicate_name. unknown_reference: missing/forward. wrong_type. mixed_currency: mismatch. division_by_zero: zero divisor. out_of_range: too large. invalid_date: bad day.

Quote each returned figure as given.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stepsYes
inputsYes
workspace_idNoTarget workspace. Optional: this tool describes the token itself rather than one workspace's data, so omitting it returns the same answer.
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

TableJSON Schema
NameRequiredDescriptionDefault
stepNo
errorNo
figuresNo
successYes
error_reasonNo
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. Added

TDQS

A4.5/5.0
Behavior4/5

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

Annotations declare readOnlyHint=true, destructiveHint=false, openWorldHint=false, so the safety profile is already covered; the description goes further by disclosing the exact-decimal computation rationale, the invalid_program/duplicate_name/unknown_reference/wrong_type/mixed_currency/division_by_zero/out_of_range/invalid_date failure modes, and per-op currency rules. Some of these are format hints that overlap the schema, but the error taxonomy and precision rationale are genuine additions.

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?

Front-loaded with the triggering rule, followed by worked example, then per-op details and error codes. Dense but well-ordered; the error-code list and currency paragraphs are compact. Slightly long, but each block carries operational information an agent must have.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a high-complexity program-composition tool, the description supplies the operand model, format invariants, per-op arguments, currency rules, and error codes. It complements the output schema (present) and annotations. Minor gaps remain around places/rounding ranges, but nothing an agent needs to construct a call is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Coverage is 60%, so the description must compensate. It explains the operand-reference model ('every operand is an input or earlier-step name'), pins amount format to a quoted decimal string, and documents op-specific arguments for take_until_total_reaches, sum_picked, div, round, and compare, which the schema leaves implicit beyond enum names. It does not cover places/rounding bounds, but the core semantics are clarified.

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?

States a specific verb+resource (compute figures) and enumerates the exact operation classes it covers: sum, difference, product, ratio, comparison, ranking, count of days. It also explicitly negates the sibling behavior ('this tool never reads data') and routes reads to well_sum_* tools, so an agent can separate it from well_get_figure and the well_sum_* family.

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?

Gives an explicit triggering rule ('Call this for any sum, difference, product, ratio, comparison, ranking or count of days') plus a strong when-not ('never compute one yourself'); it also names the alternative source for measured totals (well_sum_*), and clarifies that only already-read figures are combined.

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