Skip to main content
Glama

Merge Items

merge_items
Destructive

Merge a duplicate item into the item to keep (each by id or SKU), as the Merge items page does. The merged item's stock moves onto the kept item in each warehouse, its sales order and purchase order lines, reservations and Amazon/Shopify links are repointed, and it is deleted. The kept item keeps its own name, description, cost, price and UPCs unless takeFromMerged names fields to copy from the merged item. The preview shows both items side by side, stock per warehouse before and after, and what moves. A merge cannot be undone. Requires an operator (unpinned) credential and an Admin; both items must belong to the same client.

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": {
      "keepItem": "<keepItem>",
      "mergeItem": "<mergeItem>"
    },
    "name": "merge_items"
  }
}

Input Schema

NameRequiredDescriptionDefault
previewNoStep 1 of the required two-step write: set true to validate and receive a structured preview plus a single-use previewReceipt. Nothing changes until the commit call.
keepItemYesThe item to keep (id or SKU).
mergeItemYesThe duplicate item to merge into it and delete (id or SKU).
idempotencyKeyNoCaller-generated idempotency key; required with previewReceipt to commit.
previewReceiptNoStep 2 of the required two-step write: the receipt returned by the preview call. Supply together with a fresh idempotencyKey to commit; calls without it are refused.
takeFromMergedNoFields the kept item takes from the merged item: any of name, description, cost, price, upcs. Omit to keep all of the kept item's own values.

Output Schema

NameRequiredDescriptionDefault
okNo
auditIdNo
previewNo
expiresAtNo
keptItemIdNo
actionItemIdNo
confirmationNo
correlationIdNo
approvalResultNo
idempotencyKeyNo
previewReceiptNo
idempotentReplayNo
channelLinksRepointedNo
salesOrderLinesRepointedNo
purchaseOrderLinesRepointedNo

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?

Goes well beyond the destructiveHint/openWorldHint annotations: it discloses irreversibility ('A merge cannot be undone'), the exact side effects (stock moved per warehouse, SO/PO lines, reservations, Amazon/Shopify links repointed, source deleted), the default field-inheritance behavior, and the authorization and same-client constraints.

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?

Information is front-loaded: purpose, then side effects, then inheritance rules, then irreversibility and preconditions. Dense but nearly every clause carries information; 'as the Merge items page does' is slightly soft framing but useful orientation.

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 destructive six-parameter mutation with an output schema, the description covers what is required to act correctly: two-step preview/commit, irreversibility, permission and tenancy preconditions, and field-copy defaults. Return-value detail is correctly deferred to the output schema.

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 the baseline is 3, but the description adds real meaning: it explains the keepItem/mergeItem roles, the default that the kept item retains its own name/description/cost/price/UPCs, and what takeFromMerged overrides. The preview/idempotencyKey/previewReceipt mechanics are left to the schema, which documents them well.

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 ('Merge a duplicate item into the item to keep'), identifies the addressing scheme (id or SKU), and enumerates exactly what is repointed and deleted. The distinction between kept and merged item is unambiguous without opening the 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?

Makes clear this is for duplicate-item consolidation and describes the required preview-then-commit flow plus prerequisites (operator credential, Admin, same client). It does not name a sibling alternative or an explicit 'do not use when' case, but the conditions for use are concrete.

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