Skip to main content
Glama

Compare products side by side

compare_products
Read-onlyIdempotent

Fetch 2–6 Alza product codes and return an aligned side-by-side table for price, availability, rating, and specs to judge which product is better.

Instructions

Fetch 2–6 products by their Alza codes (the code from search_products) and return one aligned comparison table: a column per product, rows for price, availability and rating, then every spec row present in any of them (exact spec-name matching; a product missing a row shows —). Use instead of calling get_product repeatedly when the user asks which of several candidates is better. A code that fails to load is reported in its own column (ok: false, error) while the others still compare. Pages load at most two at a time, so 6 products take roughly 15–30 s on a cold cache. Optional summarize: true adds a short verdict generated by your client's LLM via MCP sampling, grounded only in the table (skipped, not an error, when sampling is unsupported). Read-only.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codesYes2–6 Alza product codes to compare side by side, e.g. ['WEXOA002B0', 'JA190b1']. These are the `code` values from `search_products` (not numeric ids). Duplicates are collapsed.
summarizeNoOpt-in: also ask your own client LLM (MCP sampling) for a short verdict grounded only in the table. Ignored with `summary.status: "unavailable"` when the client does not support sampling — the table is always returned.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
rowsYes
summaryNo
productsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.0

TDQS

A4.8/5.0
Behavior5/5

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

Goes well beyond the readOnly/openWorld/idempotent annotations by disclosing partial-failure semantics ('A code that fails to load is reported in its own column (`ok: false`, `error`) while the others still compare'), performance characteristics ('Pages load at most two at a time, so 6 products take roughly 15–30 s on a cold cache'), and the sampling-dependent behavior of `summarize` (skipped, not an error, when unsupported).

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-loaded with the core action and output shape, then failure handling, timing, and the optional summarize flag. Dense but nearly every clause carries distinct information; slightly long, though nothing is clearly redundant.

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?

Even though an output schema exists, the description explains the table's structure, partial-failure columns, latency, and the sampling caveat. Combined with the schema and annotations, an agent has everything needed to invoke and interpret the tool correctly.

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: codes are Alza codes from `search_products` rather than numeric ids, duplicates are collapsed, and `summarize` triggers a client-LLM verdict grounded only in the table with defined unavailability semantics.

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 ('Fetch 2–6 products ... return one aligned comparison table') and describes the exact output shape (column per product, rows for price/availability/rating/specs). It clearly distinguishes itself from the sibling get_product by framing the result as a side-by-side table rather than per-product lookups.

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?

Explicitly names the alternative and the condition that selects it: 'Use instead of calling `get_product` repeatedly when the user asks which of several candidates is better.' The 2–6 code constraint and the `code`-from-`search_products` sourcing are also stated, leaving little to inference.

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