Skip to main content
Glama

Edit a shopping item

shopping_update

Rename a shopping item or change or clear its quantity to fix typos or wrong amounts, using optimistic locking so concurrent edits are never overwritten.

Instructions

Rename a shopping item or change or clear its quantity, for example to fix a typo or a wrong amount, keeping its id, adder and bought state. Any member may do it. Send only the fields to change, at least one of name and quantity. To tick an item off or reopen it use shopping_set_bought; to delete it use shopping_remove. Uses optimistic locking: call shopping_list first and pass the item's updatedAt and boughtAt unchanged. If someone changed the item in between, the call fails with 409 shopping_item_changed and nothing is written: read the list again and decide again. Renaming to the name of another open item fails with 409 shopping_item_duplicate. Nobody is notified. Returns the updated item; item_not_found for an unknown id.

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": {
      "id": "<id>",
      "expectedUpdatedAt": "<expectedUpdatedAt>",
      "expectedBoughtAt": "<expectedBoughtAt>"
    },
    "name": "shopping_update"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesId of the shopping item, from shopping_list.
nameNoNew item name. Omit to keep the current one.
wgCodeNoShare code of the flat (code from wg_list). Leave it out when the account belongs to one flat.
quantityNoNew free-text amount, for example "2" or "1 kg". Send null or an empty string to clear it. Omit to keep the current one.
expectedBoughtAtYesThe item's boughtAt exactly as returned by shopping_list, or null if it is still open. Guards against concurrent edits.
expectedUpdatedAtYesThe item's updatedAt exactly as returned by shopping_list (ISO 8601 with offset). Guards against concurrent edits.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.3.0

TDQS

A4.6/5.0
Behavior4/5

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

Goes well beyond the annotations by spelling out optimistic locking (call shopping_list first, pass updatedAt and boughtAt unchanged), the 409 shopping_item_changed failure with no partial write, the 409 shopping_item_duplicate rename conflict, and that nobody is notified. The annotations already declare the non-destructive/non-idempotent profile, so this added concurrency and notification context is exactly the right surplus.

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-loads the operation and its constraints, then moves to alternatives, locking protocol, and error outcomes in a logical order. Dense but nearly every clause carries information; the concurrency sentence is slightly restated by the follow-up 'read the list again and decide again', a minor redundancy.

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?

For a mutation tool with no output schema, it covers the return value (the updated item), the not-found error, both 409 conflict modes, and the prerequisite read call. Nothing an agent needs to invoke it safely 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?

Schema coverage is 100%, so per-dimension baseline is 3, but the description adds real meaning: how expectedUpdatedAt/expectedBoughtAt are sourced and must be passed unchanged, and that only changed fields should be sent. It does not restate the per-field semantics (quantity clearing via null) that the schema already covers.

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 set and resource ("Rename a shopping item or change or clear its quantity") plus the preserved fields (id, adder, bought state). It also explicitly distinguishes itself from siblings by naming shopping_set_bought and shopping_remove for adjacent operations.

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 both when-to-use (fix a typo, wrong amount) and when-not-to-use with named alternatives: shopping_set_bought for ticking off/reopening and shopping_remove for deletion. It also states the invocation constraint that at least one of name and quantity must be sent.

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