@snowcone-app/mcp 0.8.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @snowcone-app/mcp
2
2
 
3
+ ## 0.8.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1877](https://github.com/snowcone-app/snowcone-monorepo/pull/1877) [`e2b8887`](https://github.com/snowcone-app/snowcone-monorepo/commit/e2b88879cfdd9d266bc233ae1a1171fe99ea1b5c) Thanks [@kevinsproles](https://github.com/kevinsproles)! - Add the `mcpName` field (`io.github.snowcone-app/snowcone`) to the published
8
+ package.json — the official MCP registry requires it to match the registry
9
+ `server.json` name during ownership validation of the npm package
10
+ (growth/0014 dossier, d9 pre-flight P1). Metadata only; no runtime change.
11
+
3
12
  ## 0.8.0
4
13
 
5
14
  ### Minor Changes
package/dist/index.js CHANGED
@@ -272,7 +272,8 @@ image URL. There is nothing to install to render or sell.
272
272
  start; your human can flip "Require signed URLs" later on /studio/api-keys.*
273
273
 
274
274
  2. **Find a product** \u2014 \`snowcone_search_catalog\` to browse, or
275
- \`snowcone_get_product\` for placements/mockups/options. \`BEEB77\` is a known
275
+ \`snowcone_get_product\` for placements/mockups/options. Every tool takes the
276
+ code as \`product\` (e.g. \`{ product: "BEEB77" }\`). \`BEEB77\` is a known
276
277
  good demo product code.
277
278
 
278
279
  3. **Render a mockup** \u2014 \`snowcone_render_mockup\` with the product code, your
@@ -292,7 +293,9 @@ image URL. There is nothing to install to render or sell.
292
293
  the raw cutout over a set shop default.
293
294
 
294
295
  4. **Sell it** \u2014 \`snowcone_buy_url\` builds the matching checkout URL (same
295
- inputs). Buy URLs resolve to LIVE Stripe Checkout sessions \u2014 real money, not
296
+ inputs). By default it verifies BOTH that the checkout is live and that the
297
+ matching mockup renders \u2014 "verified" means the same thing on both tools.
298
+ Buy URLs resolve to LIVE Stripe Checkout sessions \u2014 real money, not
296
299
  test-mode ("sandbox" means the shop is unclaimed, not that payments are fake);
297
300
  sales route to Snowcone until your human claims the shop.
298
301
 
@@ -542,6 +545,7 @@ function canonicalForSig(url) {
542
545
  const rawValue = eq === -1 ? "" : segment.slice(eq + 1);
543
546
  const key = decodeURIComponent(rawKey);
544
547
  if (key === "signature") continue;
548
+ if (key === "debug") continue;
545
549
  pairs.push({ key, raw: rawValue });
546
550
  }
547
551
  }
@@ -864,14 +868,26 @@ server.registerTool(
864
868
  title: "Get a product",
865
869
  description: "Fetch one product by its code (id) or slug. Returns placements (where art goes), mockups (scene ids for the 'view' param), and variant options \u2014 everything you need to build a render URL. Returns an error if the code doesn't exist (it would render blank).",
866
870
  inputSchema: {
867
- id_or_slug: z.string().min(1).describe("Product code (catalog id) or slug, e.g. 'BEEB77'.")
871
+ // eng/0049 F1 (growth/0013 cold-agent run): every sibling tool takes
872
+ // `product`, and the prose says "product code" — the one tool that
873
+ // spelled it `id_or_slug` cost every cold agent a guaranteed failed
874
+ // round-trip. `product` is the canonical name; `id_or_slug` stays as a
875
+ // silent alias so agents that learned the old name keep working.
876
+ product: z.string().min(1).optional().describe("Product code (the catalog document id) or slug, e.g. 'BEEB77'. Same name as every other tool."),
877
+ id_or_slug: z.string().min(1).optional().describe("Deprecated alias of 'product' \u2014 accepted for back-compat; prefer 'product'.")
868
878
  },
869
879
  annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true }
870
880
  },
871
881
  async (args) => {
872
882
  try {
873
- const p = await getProduct(args.id_or_slug);
874
- if (!p) return fail(`Error: no product found for '${args.id_or_slug}'. It would render blank \u2014 pick one from snowcone_search_catalog.`);
883
+ const code = args.product ?? args.id_or_slug;
884
+ if (!code) {
885
+ return fail(
886
+ "E_MISSING_PRODUCT: pass product (the product code or slug, e.g. { product: 'BEEB77' }) \u2014 the same 'product' argument snowcone_render_mockup and snowcone_buy_url take."
887
+ );
888
+ }
889
+ const p = await getProduct(code);
890
+ if (!p) return fail(`Error: no product found for '${code}'. It would render blank \u2014 pick one from snowcone_search_catalog.`);
875
891
  return ok(summarizeProduct(p));
876
892
  } catch (err) {
877
893
  return fail(formatError(err));
@@ -939,11 +955,11 @@ server.registerTool(
939
955
  "snowcone_buy_url",
940
956
  {
941
957
  title: "Build a checkout URL",
942
- description: "Build the buyable checkout url for the same product + artwork + shop you'd render. Same inputs as snowcone_render_mockup. Send a customer here to purchase the printed item. Sales route to Snowcone until your human claims the shop. By DEFAULT the server follows the URL and confirms it resolves to a live checkout (the Stripe session actually builds) \u2014 so a bad product code, shop, or option combo comes back as a clear error instead of a confident-but-broken link. This does NOT charge anything; it only builds the session. Pass verify=false to skip the check and get the URL string instantly.",
958
+ description: "Build the buyable checkout url for the same product + artwork + shop you'd render. Same inputs as snowcone_render_mockup. Send a customer here to purchase the printed item. Sales route to Snowcone until your human claims the shop. By DEFAULT the server follows the URL and confirms it resolves to a live checkout (the Stripe session actually builds) AND that the matching mockup image renders \u2014 so a bad product code, shop, option combo, or unusable asset comes back as a clear error instead of a confident-but-broken link. 'verified' means the same thing here as in snowcone_render_mockup. This does NOT charge anything; it only builds the session. Pass verify=false to skip the check and get the URL string instantly.",
943
959
  inputSchema: {
944
960
  ...urlShape,
945
961
  verify: z.boolean().optional().describe(
946
- "Follow the built URL and confirm it resolves to a live checkout before reporting success (DEFAULT true). Set false to skip the network round-trip and return the URL string unchecked."
962
+ "Follow the built URL and confirm it resolves to a live checkout, and fetch the matching mockup to confirm the product image renders, before reporting success (DEFAULT true). Set false to skip the network round-trip and return the URL string unchecked."
947
963
  )
948
964
  },
949
965
  annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true }
@@ -957,12 +973,22 @@ server.registerTool(
957
973
  url
958
974
  );
959
975
  }
960
- const v = await verifyCheckoutUrl(url);
976
+ const [v, img] = await Promise.all([verifyCheckoutUrl(url), verifyImageUrl(await renderUrl(toUrlInput(args)))]);
961
977
  if (!v.ok) {
962
978
  const reason = (v.error ?? "checkout failed").replace(/\.*$/, "");
963
979
  return fail(`Built ${url} but it does NOT resolve to a live checkout: ${reason}.`);
964
980
  }
965
- return ok({ url, verified: true, checkout_url: v.checkout_url }, `\u2713 verified \u2014 resolves to a live checkout: ${url}`);
981
+ if (!img.ok) {
982
+ const hint = renderFixHint(img.error);
983
+ const reason = (img.error ?? "render failed").replace(/\.*$/, "");
984
+ return fail(
985
+ `Built ${url} \u2014 the checkout is live, but the product image for these inputs does NOT render, so a customer would buy a broken mockup: ${reason}.${hint ? " " + hint : ""} Fix the inputs (same as snowcone_render_mockup) and call again.`
986
+ );
987
+ }
988
+ return ok(
989
+ { url, verified: true, checkout_url: v.checkout_url, render_verified: true, render_kind: img.kind },
990
+ `\u2713 verified \u2014 resolves to a live checkout AND the product image renders (${img.kind}): ${url}`
991
+ );
966
992
  } catch (err) {
967
993
  return fail(formatError(err));
968
994
  }
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@snowcone-app/mcp",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
+ "mcpName": "io.github.snowcone-app/snowcone",
4
5
  "description": "Snowcone MCP server — the agent-native quickstart. Mint a sandbox shop, browse the catalog, and turn any image into a buyable printed-merch mockup URL, all as callable tools.",
5
6
  "keywords": [
6
7
  "mcp",
@@ -42,7 +43,7 @@
42
43
  "tsup": "^8.1.0",
43
44
  "typescript": "^5.5.4",
44
45
  "vitest": "^2.1.9",
45
- "@snowcone-app/mockup-url": "0.3.0"
46
+ "@snowcone-app/mockup-url": "0.3.4"
46
47
  },
47
48
  "publishConfig": {
48
49
  "access": "public"