Skip to main content
Glama

merge_items

Merge duplicate inventory items by moving all events from one item into another and deleting the duplicate, preserving history under the surviving name.

Instructions

Fix name drift: fold every event on from_item into into_item and delete the duplicate. Canonicalisation is the agent's job, so duplicates ("milk" vs "semi-skimmed milk") are a matter of when, not if — without this the only remedy is hand-editing SQLite.

Merging is irreversible in one step but loses nothing: the events survive under the surviving name, and get_events() still shows them.

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": {
      "from_item": "<from_item>",
      "into_item": "<into_item>"
    },
    "name": "merge_items"
  }
}

Input Schema

NameRequiredDescriptionDefault
from_itemYes
into_itemYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.2.0

TDQS

A4/5.0
Behavior4/5

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

With no annotations at all, the description carries the full burden and does real work: it discloses that the operation is destructive (the duplicate is deleted), that it is "irreversible in one step," and that no data is lost because events survive under the surviving name and remain visible via get_events(). That is exactly the pre-flight information an agent needs before a mutation. It does not cover failure modes (unknown item name), permissions, or whether the merge is atomic, so it is strong but not 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?

Three sentences, front-loaded with the imperative verb and the two parameter names, so the core operation lands immediately. Each sentence adds a distinct fact (what it does, why it is needed, what it costs and preserves). Some rhetorical flourish — "a matter of when, not if," "hand-editing SQLite" — is padding that could be trimmed without losing information.

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 two-parameter mutation tool with no annotations and no output schema, the description covers the essentials: operation, both parameter roles, destructiveness, reversibility, and post-merge verifiability. What remains missing is error behavior when from_item does not exist and any returned result. Those are modest gaps against an otherwise well-covered definition.

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% — the schema offers only bare titles "From Item" and "Into Item" — so the description must compensate, and it does: from_item is the source whose events get folded and whose row is deleted, while into_item is the surviving name. That survivor-vs-deleted distinction is the single most important semantic an agent could get wrong and it is made explicit. Matching semantics (exact string, case sensitivity, alias resolution) remain unstated.

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?

"Fix name drift: fold every event on `from_item` into `into_item` and delete the duplicate" states a concrete verb (fold/merge), the two resources involved, and the side effect (deleting the emptied item). It is unmistakably a history-repointing operation rather than a read or an alias creation. The only gap is that it never names add_alias or list_aliases, so an agent must infer on its own why merge_items is different from aliasing a name.

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?

The description gives a clear triggering condition (name drift, duplicate item names like "milk" vs "semi-skimmed milk") and warns that duplicates are inevitable, which tells the agent when to reach for it. It also names the alternative remedy it replaces (hand-editing SQLite), which frames it as the sanctioned path. It stops short of explicit exclusions, e.g. when to prefer add_alias or when a merge is inappropriate.

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