Skip to main content
Glama

Variant Matrix

variant_matrix
Read-onlyIdempotent

Count the variants a set of options produces, and flag the ceilings. FREE.

Option counts multiply, so three modest lists become a number nobody intended. Typical input {"options": {"Size": ["S", "M", "L"], "Colour": ["Black", "Navy"]}} returns {"option_count": 2, "variant_count": 6, "within_limits": true, "per_option": {"Size": 3, "Colour": 2}}.

Use before building an import file, to find out whether the catalogue needs splitting into several products. Not for validating the resulting CSV's columns: that is product_csv_check. Errors: on invalid, missing, or malformed input this tool never raises a protocol error; it returns {"error": ""} (for example {"error": "options must contain at least one option"}). Every call is read-only and idempotent, so after correcting the input it is always safe to retry.

Input Schema

NameRequiredDescriptionDefault
optionsYesOption names mapped to their values, e.g. {"Size": ["S", "M"], "Colour": ["Black"]}. Each list needs at least one value.
list_rowsNoWhen true, also return every variant combination. Off by default because the list can be very large.
max_optionsNoCeiling on distinct option names. Default 3.
max_variantsNoCeiling to check against. Default 2048, which is the limit Shopify announced on 15 October 2025, up from 100. Override it if your plan differs.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint and destructiveHint=false, and the description partially restates those. It earns credit for the genuinely new error contract: never raises a protocol error, returns {'error': ...} with remediation, and is safe to retry after correction. Only the mild duplication of annotation facts keeps it below 5.

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?

The core verb and scope are front-loaded, and the example, alternative-tool routing and error contract each carry information. The 'FREE.' tag is promotional filler that does not help an agent decide or invoke.

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?

With an output schema present, the description needn't restate return shape, yet it still supplies an illustrative response, an error envelope, a sibling exclusion and retry guidance. Nothing an agent needs to call this correctly 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 the baseline is 3, and the description adds real semantic value beyond it by showing a concrete input/output pair (per_option breakdown) and explaining why counts multiply. It does not add syntax beyond what the schema already documents for list_rows/max_options/max_variants, so it is not a 5.

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 ('count the variants') and resource ('a set of options'), plus the extra behavior ('flag the ceilings'). The contrast with product_csv_check makes it distinguishable from siblings without reading schemas.

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 an explicit when ('Use before building an import file, to find out whether the catalogue needs splitting') and an explicit when-not with a named alternative ('Not for validating the resulting CSV's columns: that is product_csv_check'). Nothing is left to inference.

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.