Skip to main content
Glama

price-change-attribution

Attribute a total's change to quantity, price, FX, added and removed lines (sums exactly) — Explains why a total moved between two versions of a quote, order or invoice (up to 300 lines each), for an agent that must say how much of the change came from quantity, unit price, exchange rate, new lines and dropped lines. Lines are matched by key. Matched lines are decomposed by sequential substitution in the declared factor order (default quantity, then price, then fx), so the effects sum to

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "before": "<before>",
      "after": "<after>"
    },
    "name": "price-change-attribution"
  }
}

Input Schema

NameRequiredDescriptionDefault
fxNoMultiplier from line currency to reporting currency, before and after. Default 1 and 1.
afterYes
orderNoSubstitution order of the factors; each at most once. Default [quantity, price, fx].
beforeYes
currencyNoISO 4217 alphabetic code, upper case.
exponentNo
roundingNoDefault half-even. half-up: ties away from zero. half-down: ties toward zero. half-even: ties to the even neighbour. up: away from zero. down: toward zero. ceiling: toward +infinity. floor: toward -infinity.
statedAfterTotalNoOptional stated total of `after` to verify.
statedBeforeTotalNoOptional stated total of `before` (reporting currency) to verify.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.7/5.0
Behavior4/5

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

No annotations are supplied, so the description carries the full disclosure burden, and it does meaningful work: it names line matching by key, the 300-line cap, the sequential-substitution algorithm, the default factor order, and the exact-sum property. It falls short on the failure and boundary surface — what happens for unmatched keys, mismatched stated totals, or which currency/exponent the effects are reported in — and the final clause is cut off mid-sentence ('so the effects sum to').

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

Conciseness3/5

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

Front-loaded and readable, but the first two clauses are redundant — 'Attribute a total's change to quantity, price, FX, added and removed lines' and 'Explains why a total moved … how much of the change came from quantity, unit price, exchange rate …' say the same thing twice with different vocabulary. The text also terminates mid-sentence, which reads as an unfinished definition rather than deliberate brevity.

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

Completeness3/5

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

With nine parameters, nested line objects, and no output schema, the description should say what comes back — a breakdown per factor, per line, and a verification outcome — but it never describes the response at all. It covers the computational model well while leaving the agent guessing about the result shape and about error conditions.

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 coverage is 67% and the description adds real meaning for a few inputs: `order` is explained as the substitution sequence with its default, and `before`/`after` are framed as versioned line sets matched by key. It says nothing about `rounding`, `exponent`, `currency`, or the two `statedBeforeTotal`/`statedAfterTotal` verification parameters, leaving the highest-risk optional inputs to the schema alone.

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 and resource: attribute a total's change to quantity, price, FX, added and removed lines, with an exact-sum guarantee. The clause 'Explains why a total moved between two versions of a quote, order or invoice' pins the domain precisely enough that an agent can tell this is not a generic diff or arithmetic tool.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied rather than stated: it is 'for an agent that must say how much of the change came from quantity, unit price, exchange rate, new lines and dropped lines', which mostly restates the purpose. There is no guidance on when to prefer this over a plain total diff, when to supply `order`, `fx`, `currency`, `rounding` or the `stated*` verification fields, or what to do when lines do not match.

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