A buyer who needs a spare part rarely knows its number. They know their machine: a road bike, 11-speed, disc brakes, a 12x142 rear axle. So parts search has to start there, and the hard part is not matching words but deciding what fits. I built search that starts from the machine on a commercial parts platform; that code is not mine to publish, so here is the same idea on an open-source reference store with an invented catalog, where every number below can be rerun: mcp-commerce-evals (Rust, MIT).

Compatibility is data, with dimensions

The store's catalog has 500 parts, and each one lists what it fits as tags in five dimensions: drivetrain speed, bike type, wheel size, brake type and axle standard. One rule decides whether a part fits a bike:

pub fn is_compatible(fits: &[String], required: &[String]) -> bool { required.iter().all(|req| match dimension_of(req) { Some(dim) => { let constrained = fits.iter().any(|t| dim.contains(&t.as_str())); !constrained || fits.contains(req) } None => fits.contains(req), }) } 

A part that lists no tag in a dimension does not care about it: a saddle fits any drivetrain. A part that lists some tags in a dimension fits only a bike with one of them: an 11-speed chain does not fit a 12-speed bike. Before the rule runs, what the buyer typed is made canonical, so 11 speed becomes 11-speed, Disc Brakes becomes disc-brake, 29er becomes 29in and MTB becomes mountain.

Filter, do not only match words

The tags are also indexed as text, so a sentence works on its own: "a chain that fits my 11-speed road bike" drops the filler words and searches for chain, 11speed and road. But a long sentence mixes words about the part with words about the bike, and the bike words can win.

"rear hub for a 12x142 thru axle frame with an 11-speed disc brake setup", sent as text only, returns five thru axles first. "Thru axle" and "12x142" are in their titles; the first expected hub is 9th. The same need sent as query: "rear hub", category: "hub" and fits: ["12x142", "11-speed", "disc-brake"] returns five hubs, all of them right.

The filters have their own trap. "11-speed chain, in stock, under $30" with fits: ["11-speed"], stock and price filters but no category returns chain lube first. Lube lists no compatibility tags, so by the rule above it fits every bike and passes every fit filter, and the word "chain" is in its title. Add category: "chain" and the search returns exactly the three expected chains. Universal parts are correct for the rule and noise for the buyer: a fit filter needs a category next to it.

That is why the store's search_products tool takes free text plus brand, category, fits, in_stock_only and max_price_usd, and its description tells the assistant what fits looks like. The hub query shows what it is worth when the assistant turns "my bike" into filters instead of pasting the sentence.

The eval marked a good question wrong

The repo measures the store twice: tool-level, by calling the search tool directly, and assistant-level, by letting a model shop through the tools and scoring the part id it commits to. On the 8 compatibility queries the tool-level hit@1 is 0.88 (95% interval 0.53 to 0.98); the one miss is the hub query above. With an assistant on top, Claude Haiku (3 trials per query) and Claude Sonnet (1 trial) both scored 0.88 on the same kind.

The misses were not retrieval failures. On "disc rotor that works on my e-bike" twelve rotors fit by tag: five centerlock and seven 6-bolt, in 180 or 203 mm. Both models listed rotors and asked two questions: is the hub 6-bolt or centerlock, and which diameter. Haiku did that in all three trials and committed nothing; Sonnet committed none.

Both questions are right. A rotor has to match the hub's mount, and the frame or fork caps the diameter, as Sonnet's reply added. In this catalog the hub and the rotor both record their mount, but as plain attributes: mount is not one of the five dimensions, so no fit filter can use it. And the catalog has no frames or forks, so nothing records a maximum rotor size. The scorer rewards committing to a part, so asking back counts as a miss.

"skewer for my road bike" shows the other way to handle a missing fact. In one of three trials Haiku asked whether the bike is quick-release or thru-axle and committed nothing. Sonnet wrote "I'm assuming your bike has quick-release dropouts", named the 12x142 and 12x100 thru axles it would offer otherwise, and committed to a skewer. Same uncertainty, but the buyer gets an answer and a way to correct it.

Three things I take from it:

  • The assistant found holes in the compatibility model before any buyer did: brake mount should be a dimension that constrains both rotors and hubs, and the maximum rotor size belongs to the frame and fork.
  • "Asked a fair question" should be its own outcome in an eval, not a failure. Otherwise the score pushes you toward an assistant that guesses.
  • When one answer is far more likely, "assume it, say so, commit" serves the buyer better than a list of questions. The tool description is the place to ask for that.

What I would not claim

Eight compatibility queries is a small sample, and the interval runs from 0.53 to 0.98. I wrote the catalog and the queries myself, so this shows that compatibility can be modelled and measured, not how well any real store does. The model runs had no fixed temperature, so a rerun will differ.

The rule, the tags and the eval are in the repo: github.com/Vladimir-Pirotskiy/mcp-commerce-evals. The first post, on what the evals measured overall: I measured how well an AI assistant shops through MCP. More of my work: pirotskiy.com.