Skip to main content
Glama

Record a purchase in the savings record

record_purchases
Idempotent

Add a receipt to the user's savings record: one row per line (generic item, quantity, unit, paidMinor in cents, optional offerId from search_offers). Each line is stored with its price range around the store that day (cheapest, typical, priciest) and returns savings vs each plus the percentile; negative savings (paid above typical) are kept. Lines on a thin range are shown but not totalled. Each line has basis (what it was compared with) or notCounted (why not) and a plain summary; the receipt has a summary, method and methodUrl (how savings are counted, an estimate compared with typical prices nearby) to pass on to the user. Append-only and idempotent: reuse operationId to retry safely; to fix a purchase, record a new one with supersedesPurchaseId.

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": {
      "operationId": "<operationId>",
      "purchasedOn": "<purchasedOn>",
      "near": "<near>",
      "basis": "<basis>",
      "lines": "<lines>"
    },
    "name": "record_purchases"
  }
}

Input Schema

NameRequiredDescriptionDefault
nearYesThe store's postal code, or the shopper's; sets which stores the range is drawn from.
basisYesreceipt: read from a receipt; user_report: the user said so.
linesYes
bannerNoWhere it was bought, e.g. "no-frills".
storeIdNoThe store's id from stores_near, when known.
radiusKmNoSearch radius in km around `near` (default 5).
operationIdYesA stable id for this write (e.g. a UUID you generate once per receipt). Replaying it returns the same receipt.
purchasedOnYesPurchase date, YYYY-MM-DD.
correctionReasonNo
supersedesPurchaseIdNoA purchase this one corrects; the old one stays stored but leaves the totals.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare idempotent=true and destructive=false, and the description adds real substance on top: append-only storage, negative savings retained, lines on a thin range shown but not totalled, and the per-line basis/notCounted plus receipt-level summary/method/methodUrl that must be passed to the user. That is meaningful disclosure of storage and calculation behavior an agent could not infer from the annotations.

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?

The core action and the return shape are front-loaded, and every clause carries information about storage or output. The semicolon-chained sentences are dense, and the parenthetical about methodUrl could be trimmed, but there is no filler.

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?

With no output schema, the description carries full burden and does it: it enumerates the returned per-line fields (savings vs cheapest/typical/priciest, percentile, basis or notCounted) and the receipt-level summary/method/methodUrl. Combined with a 10-parameter, 80%-documented schema, an agent has enough to invoke it correctly.

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?

Schema coverage is 80%, so the baseline is 3; the description goes further by tying item to how compare_items takes it (generic, not brand/receipt code), tying offerId to search_offers, and explaining paidMinor-in-cents and the operationId retry contract. It doesn't explain near, radiusKm, or banner beyond the schema, hence not a 5.

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?

"Add a receipt to the user's savings record: one row per line" states a specific verb, resource, and granularity. The field list (item, quantity, unit, paidMinor, optional offerId) and the savings-computation outcome make it clearly distinct from siblings like search_offers, compare_items, or get_savings without opening any schema.

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

Usage Guidelines4/5

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

It gives clear operating guidance: reuse operationId to retry safely, and to fix a purchase record a new one with supersedesPurchaseId rather than editing. It also names search_offers as the source for offerId. What's missing is explicit when-not guidance versus recording nothing or using a list tool, but the correction/retry paths are well covered.

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