Skip to main content
Glama

add_items

Record purchase receipts and item lines into a household inventory, preserve purchase dates, and skip duplicate entries by source reference and line number.

Instructions

Record a purchase (one receipt). Idempotent per (source_ref, line_no).

Each item: {name, quantity, unit, price?, category?, line_no}.

source, and whether purchased_at is required: 'email' a receipt email — REQUIRED, the receipt carries a date 'photo' a photographed receipt — REQUIRED, the paper carries a date 'loyalty' a Clubcard/Nectar export — REQUIRED, the export carries a date 'barcode' scanned in the shop — optional, defaults to today 'manual' typed by the user — optional, defaults to today Only the two "happening right now" doors may default. Dating an old paper receipt or a three-year loyalty export as today would silently corrupt the repurchase intervals that every estimate is derived from.

source_ref: retailer ORDER ID where extractable, else email Message-ID; manual fallback 'manual:::' (+':2' suffix on collision — a nonzero 'ignored' count on a fresh receipt signals one). Call get_stock() first and reuse existing item names exactly. Returns {inserted, ignored, rejected: [{line_no, reason}]}.

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": {
      "items": "<items>",
      "source": "<source>",
      "source_ref": "<source_ref>"
    },
    "name": "add_items"
  }
}

Input Schema

NameRequiredDescriptionDefault
itemsYes
sourceYes
locationNo
source_refYes
purchased_atNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description carries the full load and does so well: idempotency is disclosed per (source_ref, line_no), partial-failure behavior is described via the rejected array with reasons, and the nonzero 'ignored' count is explained as a collision signal. Auth requirements, rate limits, and what happens to previously recorded items are not covered, so it falls short of exhaustive.

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 core action, then a compact source table, then identifier rules, then the return shape — a sensible information hierarchy with no filler sentences. The digression about silently corrupting repurchase intervals is editorial but earns its place by justifying the date requirement.

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 mutation tool with no annotations and no output schema, the description covers the return contract, the validation failure shape, and the dating rules — enough to call it correctly. Remaining gaps are the undocumented location parameter and any constraints on price/unit formats inside items.

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 0%, and the description compensates heavily: it defines the item object fields (name, quantity, unit, price?, category?, line_no), enumerates the five valid source values, and gives concrete source_ref formats including the manual fallback and collision suffix. The location parameter is never mentioned, which is the one clear gap for a 5-parameter tool.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening line gives a specific verb and resource — "Record a purchase (one receipt)" — and the item shape plus source enum make the scope unambiguous. It does not explicitly distinguish itself from the sibling add_capture, so an agent must infer which door to use for raw receipt intake versus structured line insertion.

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?

Strong conditional guidance: it spells out per-source whether purchased_at is required or defaultable, and instructs calling get_stock() first and reusing existing item names exactly. The rationale (protecting repurchase intervals) makes the rule memorable. It stops short of stating when NOT to use this tool versus add_capture/add_alias.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.