Skip to main content
Glama
trhonpavel
by trhonpavel

Create or update collection

save_collection
Idempotent

Create or update a Medusa product collection: omit collection_id to create (title required) or include it to update, then add or remove product IDs.

Instructions

Without collection_id creates a collection (title required); with collection_id updates it. Can add or remove products (a product belongs to at most one collection).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleNo
handleNo
metadataNoMerged into existing metadata; an empty string deletes a key
add_productsNoProduct IDs to add
collection_idNo
remove_productsNoProduct IDs to remove

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.3.0

TDQS

A3.8/5.0
Behavior3/5

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

Annotations already disclose that this is a non-destructive, idempotent, open-world write, so the safety profile is covered. The description adds one genuinely behavioral fact: 'a product belongs to at most one collection', which warns the agent that adding a product may implicitly move it. It does not explain what happens to title/handle conflicts, or whether removed products are deleted or merely detached.

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?

Two dense sentences, front-loaded with the create/update branch that determines everything else. Every clause earns its place; the only minor cost is that the parenthetical product-membership rule is squeezed in rather than given its own emphasis.

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 dual-mode tool with six parameters, no required markers, and no output schema, the description covers the decision-critical facts: mode selection, the required field for creation, and the product-membership side effect. Gaps are minor — no mention of handle conflicts or validation behavior — and the absence of an output schema excuses return-value detail.

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 description coverage is only 50%, and the schema marks zero parameters as required, so the description carries real load: it states title is required for creation, and it explains add_products/remove_products by describing the one-collection membership constraint. handle and the update-mode requirements remain undocumented in the description, but it meaningfully compensates for the coverage gap.

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 description states a specific verb+resource pair (create/update collection) and makes the branch condition explicit: 'Without collection_id creates a collection (title required); with collection_id updates it.' That conditional framing is more precise than the title alone and lets an agent pick the right mode without opening the schema. It does not, however, compare itself to sibling tools such as delete_collection or save_category.

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 routing guidance on the create-vs-update decision, which is the primary ambiguity for a 'save' tool. It also implies product-association usage via add_products/remove_products. It stops short of naming when to avoid this tool (e.g., use delete_collection instead), so no explicit exclusions.

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