@snowcone-app/mcp 0.8.1 → 0.9.0
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 +30 -0
- package/README.md +2 -0
- package/dist/index.js +176 -14
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# @snowcone-app/mcp
|
|
2
2
|
|
|
3
|
+
## 0.9.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#3871](https://github.com/snowcone-app/snowcone-monorepo/pull/3871) [`8b6f799`](https://github.com/snowcone-app/snowcone-monorepo/commit/8b6f799d9484e81edcbe5a963a3556df036b5908) Thanks [@kevinsproles](https://github.com/kevinsproles)! - Two new tools complete the path from preview to delivery. `snowcone_get_quote` gives the price, shipping options and delivery estimates before anyone buys; `snowcone_get_order_status` finds where an order is from its order number and email.
|
|
8
|
+
|
|
9
|
+
## 0.8.5
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#3593](https://github.com/snowcone-app/snowcone-monorepo/pull/3593) [`5d2c65d`](https://github.com/snowcone-app/snowcone-monorepo/commit/5d2c65df4ea41b865e373893a1acefa532113ab2) Thanks [@kevinsproles](https://github.com/kevinsproles)! - Raise the `@modelcontextprotocol/sdk` floor to a release with the security fixes.
|
|
14
|
+
|
|
15
|
+
## 0.8.4
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [#3474](https://github.com/snowcone-app/snowcone-monorepo/pull/3474) [`3b6ba6e`](https://github.com/snowcone-app/snowcone-monorepo/commit/3b6ba6e9854c6864d3f6521f2d39d2e8c28131a3) Thanks [@kevinsproles](https://github.com/kevinsproles)! - `snowcone_mint_shop` takes an optional `image_url`: the store then opens stocked with best-sellers wearing that image, as real listings at catalog prices with mockups and checkout. The result lists them (`lineup`), each with its price, page and mockup.
|
|
20
|
+
|
|
21
|
+
## 0.8.3
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- [#3459](https://github.com/snowcone-app/snowcone-monorepo/pull/3459) [`0ead8b8`](https://github.com/snowcone-app/snowcone-monorepo/commit/0ead8b8e3e8f4700181df41eada8e3043814c0fc) Thanks [@kevinsproles](https://github.com/kevinsproles)! - `snowcone_mint_shop` passes the shop's live store link through: when the API returns a `store_url`, the result's first line is "Your store is live at <url>", telling the agent to show the link to the person it's helping. The `name` you mint with now also names the store's web address.
|
|
26
|
+
|
|
27
|
+
## 0.8.2
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- [#3425](https://github.com/snowcone-app/snowcone-monorepo/pull/3425) [`fc809c9`](https://github.com/snowcone-app/snowcone-monorepo/commit/fc809c9b87f54d1cd24c1c996fb9ea4110813d78) Thanks [@kevinsproles](https://github.com/kevinsproles)! - Tool descriptions now open with the user's request in plain words (custom t-shirts, mugs, hoodies, totes and posters from any photo or design; a photoreal preview; a link to buy) before the integration detail, so agents pick the right tool for "put my photo on a mug" requests.
|
|
32
|
+
|
|
3
33
|
## 0.8.1
|
|
4
34
|
|
|
5
35
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -50,7 +50,9 @@ URL builder is bundled in).
|
|
|
50
50
|
| `snowcone_search_catalog` | Full-text search the public product catalog. |
|
|
51
51
|
| `snowcone_get_product` | Placements / mockups / options for one product. |
|
|
52
52
|
| `snowcone_render_mockup` | Build an `<img>`-ready mockup URL from a product + artwork + shop. |
|
|
53
|
+
| `snowcone_get_quote` | The price, shipping options and delivery estimates, before anyone buys. |
|
|
53
54
|
| `snowcone_buy_url` | Build the matching checkout URL. |
|
|
55
|
+
| `snowcone_get_order_status` | Where an order is, from its order number and email. |
|
|
54
56
|
|
|
55
57
|
## The happy path
|
|
56
58
|
|
package/dist/index.js
CHANGED
|
@@ -208,10 +208,34 @@ function summarizeProduct(p) {
|
|
|
208
208
|
key: pl.key ?? pl.label?.toLowerCase().replace(/\s+/g, "_"),
|
|
209
209
|
label: pl.label,
|
|
210
210
|
type: pl.type ?? "image",
|
|
211
|
-
...pl.width && pl.height ? { size: `${pl.width}x${pl.height}` } : {}
|
|
211
|
+
...pl.width && pl.height ? { size: `${pl.width}x${pl.height}` } : {},
|
|
212
|
+
// ADR-0099: on a bundle the key is role-scoped ("top.front") and names
|
|
213
|
+
// which member product it belongs to — two members can both have a
|
|
214
|
+
// "Front", so agents must address placements by key, never by label.
|
|
215
|
+
...pl.role ? { role: pl.role, member: pl.memberProductId } : {}
|
|
212
216
|
})),
|
|
213
|
-
mockups: (p.mockups ?? []).map((m) => ({
|
|
214
|
-
|
|
217
|
+
mockups: (p.mockups ?? []).map((m) => ({
|
|
218
|
+
id: m.id,
|
|
219
|
+
name: m.name,
|
|
220
|
+
placement: m.placement,
|
|
221
|
+
...m.picks ? { picks: m.picks } : {}
|
|
222
|
+
})),
|
|
223
|
+
...p.options ? { options: p.options } : {},
|
|
224
|
+
...p.bundle?.members?.length ? { bundle: summarizeBundle(p.bundle) } : {}
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
function summarizeBundle(bundle) {
|
|
228
|
+
const members = (bundle.members ?? []).map((m) => ({
|
|
229
|
+
role: m.role,
|
|
230
|
+
required: m.required !== false,
|
|
231
|
+
products: (m.products ?? []).map((p) => p.productId),
|
|
232
|
+
default: m.products?.[0]?.productId
|
|
233
|
+
}));
|
|
234
|
+
return {
|
|
235
|
+
members,
|
|
236
|
+
...bundle.priceRule !== void 0 ? { price_rule: bundle.priceRule } : {},
|
|
237
|
+
uncovered_pick_sets: bundle.uncoveredPickSets ?? [],
|
|
238
|
+
grammar: "asset=<url> seeds every member; asset.<role>=<url> one member; asset.<role>.<key>=<url> one placement; pick.<role>=<productId> chooses a slot's alternative; variant.<role>=<gvid> and opt.<role>.<attribute>=<choice> select per slot. Bare variant= / opt.<attribute>= are refused on a bundle (E_BUNDLE_ROLE_REQUIRED)."
|
|
215
239
|
};
|
|
216
240
|
}
|
|
217
241
|
|
|
@@ -236,6 +260,44 @@ async function searchDesigns(query, limit, offset, filter, semanticRatio) {
|
|
|
236
260
|
return { hits: body.hits ?? [], estimatedTotalHits: body.estimatedTotalHits ?? body.hits?.length ?? 0 };
|
|
237
261
|
}
|
|
238
262
|
|
|
263
|
+
// src/orders.ts
|
|
264
|
+
async function getQuote(input) {
|
|
265
|
+
const q = new URLSearchParams({ quote: "1" });
|
|
266
|
+
if (input.quantity !== void 0) q.set("qty", String(input.quantity));
|
|
267
|
+
if (input.shipTo !== void 0) q.set("ship_to", input.shipTo);
|
|
268
|
+
for (const [attr, choice] of Object.entries(input.options ?? {})) q.set(`opt.${attr}`, choice);
|
|
269
|
+
return httpJson(`${BUY_BASE}/${encodeURIComponent(input.product)}?${q.toString()}`);
|
|
270
|
+
}
|
|
271
|
+
var usd = (cents) => `$${(cents / 100).toFixed(2)}`;
|
|
272
|
+
var arrival = (s) => s.estimatedDelivery ? `arrives ${s.estimatedDelivery.earliest} to ${s.estimatedDelivery.latest}` : "no delivery estimate yet";
|
|
273
|
+
function quoteText(q) {
|
|
274
|
+
const label = q.variantLabel ? ` (${q.variantLabel})` : "";
|
|
275
|
+
const each = q.quantity > 1 ? `${usd(q.unitPriceCents)} each \xD7 ${q.quantity} = ${usd(q.itemsTotalCents)}` : usd(q.unitPriceCents);
|
|
276
|
+
const speeds = q.shipping.map((s) => `- ${s.speed}: ${s.priceCents === 0 ? "free" : usd(s.priceCents)}, ${arrival(s)}`);
|
|
277
|
+
return [
|
|
278
|
+
`${q.product.name}${label}: ${each}, plus tax at checkout.`,
|
|
279
|
+
`Shipping to ${q.shipTo}:`,
|
|
280
|
+
...speeds,
|
|
281
|
+
"Nothing has been ordered. snowcone_buy_url builds the link to buy it."
|
|
282
|
+
].join("\n");
|
|
283
|
+
}
|
|
284
|
+
async function getOrderStatus(input) {
|
|
285
|
+
return httpJson(`${API_BASE}/orders/lookup`, { method: "POST", body: input });
|
|
286
|
+
}
|
|
287
|
+
function orderStatusText(r) {
|
|
288
|
+
const o = r.order;
|
|
289
|
+
const packages = o.packages.map((p) => {
|
|
290
|
+
const when = p.deliveredAt ? `delivered ${p.deliveredAt.slice(0, 10)}` : p.estimatedDeliveryAt ? `expected ${p.estimatedDeliveryAt.slice(0, 10)}` : "no delivery estimate yet";
|
|
291
|
+
return `- ${p.carrier} ${p.trackingNumber}, ${when}${p.trackingUrl ? ` (${p.trackingUrl})` : ""}`;
|
|
292
|
+
});
|
|
293
|
+
return [
|
|
294
|
+
`Order ${o.order.number}: ${o.headline}`,
|
|
295
|
+
...packages,
|
|
296
|
+
...o.events[0] ? [`Latest: ${o.events[0].text}${o.events[0].detail ? `, ${o.events[0].detail}` : ""} (${o.events[0].at.slice(0, 10)})`] : [],
|
|
297
|
+
...r.statusUrl ? [`Their order page: ${r.statusUrl}`] : []
|
|
298
|
+
].join("\n");
|
|
299
|
+
}
|
|
300
|
+
|
|
239
301
|
// src/version.ts
|
|
240
302
|
import { createRequire } from "module";
|
|
241
303
|
var VERSION = (() => {
|
|
@@ -292,13 +354,18 @@ image URL. There is nothing to install to render or sell.
|
|
|
292
354
|
per-render \`bg\` > shop default > transparent. \`bg: "transparent"\` forces
|
|
293
355
|
the raw cutout over a set shop default.
|
|
294
356
|
|
|
295
|
-
4. **Sell it** \u2014 \`
|
|
357
|
+
4. **Sell it** \u2014 \`snowcone_get_quote\` tells the person the price, shipping and
|
|
358
|
+
delivery estimate first (it creates nothing). Then
|
|
359
|
+
\`snowcone_buy_url\` builds the matching checkout URL (same
|
|
296
360
|
inputs). By default it verifies BOTH that the checkout is live and that the
|
|
297
361
|
matching mockup renders \u2014 "verified" means the same thing on both tools.
|
|
298
362
|
Buy URLs resolve to LIVE Stripe Checkout sessions \u2014 real money, not
|
|
299
363
|
test-mode ("sandbox" means the shop is unclaimed, not that payments are fake);
|
|
300
364
|
sales route to Snowcone until your human claims the shop.
|
|
301
365
|
|
|
366
|
+
Afterwards, \`snowcone_get_order_status\` finds the order from its order number
|
|
367
|
+
and email.
|
|
368
|
+
|
|
302
369
|
5. **Hand off to your human** (optional, to get paid) \u2014 give them
|
|
303
370
|
\`claim.verification_uri_complete\`. Poll \`snowcone_claim_status\` to watch it
|
|
304
371
|
flip to \`claimed\`. When done iterating, \`snowcone_release_shop\` frees it.
|
|
@@ -351,7 +418,8 @@ function mintShop(input) {
|
|
|
351
418
|
...input.require_signed_urls ? { require_signed_urls: true } : {},
|
|
352
419
|
// `!== undefined` (not truthiness): an empty string must reach the
|
|
353
420
|
// backend and fail loudly there, exactly like it would on the PATCH.
|
|
354
|
-
...input.mockup_bg_color !== void 0 ? { mockup_bg_color: input.mockup_bg_color } : {}
|
|
421
|
+
...input.mockup_bg_color !== void 0 ? { mockup_bg_color: input.mockup_bg_color } : {},
|
|
422
|
+
...input.image_url !== void 0 ? { image_url: input.image_url } : {}
|
|
355
423
|
}
|
|
356
424
|
});
|
|
357
425
|
}
|
|
@@ -441,12 +509,17 @@ function requireBgColor(raw) {
|
|
|
441
509
|
}
|
|
442
510
|
return bg;
|
|
443
511
|
}
|
|
512
|
+
var MAX_RENDER_URL_LENGTH = 12 * 1024;
|
|
444
513
|
var PARAM_PREFIX = {
|
|
445
514
|
asset: "asset.",
|
|
446
515
|
color: "color.",
|
|
447
516
|
tile: "tile.",
|
|
448
517
|
align: "align.",
|
|
449
|
-
opt: "opt."
|
|
518
|
+
opt: "opt.",
|
|
519
|
+
/** ADR-0099 bundles: `variant.<role>=<gvid>` — one SKU per member slot. */
|
|
520
|
+
variant: "variant.",
|
|
521
|
+
/** ADR-0099 bundles: `pick.<role>=<productCode>` — which alternative fills a slot. */
|
|
522
|
+
pick: "pick."
|
|
450
523
|
};
|
|
451
524
|
var DEFAULT_PUBLIC_BASE_URL = "https://img.snowcone.app";
|
|
452
525
|
function buildPublicMockupUrl(options, cfg = {}) {
|
|
@@ -650,7 +723,7 @@ server.registerTool(
|
|
|
650
723
|
"snowcone_quickstart",
|
|
651
724
|
{
|
|
652
725
|
title: "Snowcone Quickstart",
|
|
653
|
-
description: "Return the entire Snowcone model and the recommended tool order in one screen. Call this FIRST when you're new to Snowcone \u2014 it explains how to mint a shop, render a mockup, and sell it, plus the silent-failure gotchas.",
|
|
726
|
+
description: "Make custom printed products from any photo, design or text \u2014 t-shirts, mugs, hoodies, totes, posters \u2014 with a photoreal preview and a link to buy, printed and shipped for the user. Return the entire Snowcone model and the recommended tool order in one screen. Call this FIRST when you're new to Snowcone \u2014 it explains how to mint a shop, render a mockup, and sell it, plus the silent-failure gotchas.",
|
|
654
727
|
inputSchema: {},
|
|
655
728
|
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false }
|
|
656
729
|
},
|
|
@@ -660,15 +733,18 @@ server.registerTool(
|
|
|
660
733
|
"snowcone_mint_shop",
|
|
661
734
|
{
|
|
662
735
|
title: "Mint a sandbox Shop",
|
|
663
|
-
description: "Mint your OWN sandbox Shop ID \u2014 no account or human needed. Returns { shop_id, shop_secret, api_key, api_key_scopes, claim }. IMPORTANT: mint ONCE and reuse the shop_id for all render/buy calls \u2014 minting is rate-limited (60/hour, 200 unclaimed per IP \u2192 HTTP 429). shop_id is public (use it as 'shop'); shop_secret and api_key are secret (server-side only). To get paid, hand claim.verification_uri_complete to your human and poll snowcone_claim_status.",
|
|
736
|
+
description: "Start a print-on-demand merch store for a creator, podcast or brand in one call \u2014 no account, no inventory; every order is printed and shipped. Mint your OWN sandbox Shop ID \u2014 no account or human needed. Returns { shop_id, shop_secret, api_key, api_key_scopes, store_url, lineup, claim }. When store_url is set, the shop is already a live store at that link \u2014 show it to the person you're helping. Pass image_url (the person's art, logo or photo) and the store opens stocked with best-sellers wearing that image \u2014 real listings at catalog prices, with mockups and checkout \u2014 listed in lineup. IMPORTANT: mint ONCE and reuse the shop_id for all render/buy calls \u2014 minting is rate-limited (60/hour, 200 unclaimed per IP \u2192 HTTP 429). shop_id is public (use it as 'shop'); shop_secret and api_key are secret (server-side only). To get paid, hand claim.verification_uri_complete to your human and poll snowcone_claim_status.",
|
|
664
737
|
inputSchema: {
|
|
665
|
-
name: z.string().optional().describe("Optional
|
|
738
|
+
name: z.string().optional().describe("Optional shop name (e.g. 'Jess Prints'); it also names the store's web address. Defaults to 'Sandbox <id>'."),
|
|
666
739
|
claim_pin: z.string().optional().describe("Optional out-of-band PIN your human must enter to claim (deliver it separately from the link)."),
|
|
667
740
|
require_signature: z.boolean().optional().describe(
|
|
668
741
|
"Lock the shop down: require SIGNED mockup URLs (L3). Default false \u2014 the shop is open and any unsigned URL renders (simplest to start). Set true to harden against Shop-ID theft: then every render/buy URL must be signed with the returned shop_secret (pass it as shop_secret to snowcone_render_mockup / buy URLs). Unsigned URLs will 403."
|
|
669
742
|
),
|
|
670
743
|
mockup_bg_color: z.string().optional().describe(
|
|
671
744
|
"Default background painted behind every mockup render (6-hex, '#' optional, e.g. 'f5f0ea'). Visible only where the mockup scene is transparent (studio-cutout shots). Omit for transparent (the default). Change it later with snowcone_set_mockup_background; a per-render bg overrides it."
|
|
745
|
+
),
|
|
746
|
+
image_url: z.string().url().optional().describe(
|
|
747
|
+
"Optional art for the store to open with: an https URL of a public PNG, JPEG, WebP or AVIF image (at most 10 MB). The store then opens stocked with best-sellers wearing that image, ready to sell. A bad image fails the mint with a typed E_MINT_IMAGE_* error and creates nothing. Omit for an empty store that shows what it will sell once art is added."
|
|
672
748
|
)
|
|
673
749
|
},
|
|
674
750
|
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true }
|
|
@@ -679,12 +755,17 @@ server.registerTool(
|
|
|
679
755
|
...args.name !== void 0 ? { name: args.name } : {},
|
|
680
756
|
...args.claim_pin !== void 0 ? { claim_pin: args.claim_pin } : {},
|
|
681
757
|
...args.require_signature ? { require_signed_urls: true } : {},
|
|
682
|
-
...args.mockup_bg_color !== void 0 ? { mockup_bg_color: args.mockup_bg_color } : {}
|
|
758
|
+
...args.mockup_bg_color !== void 0 ? { mockup_bg_color: args.mockup_bg_color } : {},
|
|
759
|
+
...args.image_url !== void 0 ? { image_url: args.image_url } : {}
|
|
683
760
|
});
|
|
684
761
|
const sigLine = r.require_signed_urls ? `This shop REQUIRES signed URLs: pass shop_secret=${r.shop_secret} as shop_secret on every render/buy call, or the edge 403s.
|
|
685
762
|
` : `This shop is OPEN (unsigned URLs render). To lock it later, your human can toggle "Require signed URLs" on /studio/api-keys.
|
|
686
763
|
`;
|
|
687
|
-
const
|
|
764
|
+
const storeLine = r.store_url ? `Your store is live at ${r.store_url} \u2014 show this link to the person you're helping.
|
|
765
|
+
` : "";
|
|
766
|
+
const lineupLine = r.lineup?.listings.length ? `It opened stocked with ${r.lineup.listings.length} best-sellers wearing your image:
|
|
767
|
+
` + r.lineup.listings.map((l) => `- ${l.product_name} \u2014 $${(l.price_cents / 100).toFixed(2)}${l.url ? ` \u2014 ${l.url}` : ""} (mockup: ${l.mockup_url})`).join("\n") + "\n" : "";
|
|
768
|
+
const text = storeLine + lineupLine + `Minted shop_id=${r.shop_id} (REUSE this \u2014 don't mint again).
|
|
688
769
|
shop_secret=${r.shop_secret} (secret)
|
|
689
770
|
api_key=${r.api_key} (secret; scopes: ${r.api_key_scopes.join(", ")})
|
|
690
771
|
` + sigLine + `To get paid, send your human: ${r.claim.verification_uri_complete}
|
|
@@ -767,7 +848,7 @@ server.registerTool(
|
|
|
767
848
|
"snowcone_search_catalog",
|
|
768
849
|
{
|
|
769
850
|
title: "Search the product catalog",
|
|
770
|
-
description: "Full-text search the public Snowcone catalog (t-shirts, hoodies, mugs, \u2026). Returns matching products with their code (id), name, price_cents (suggested retail, USD cents), and placement/mockup counts. Use snowcone_get_product for the full placement/mockup/option detail needed to render.",
|
|
851
|
+
description: "Find products to put a photo or design on \u2014 t-shirts, hoodies, mugs, totes, posters and more \u2014 with their suggested retail prices. Full-text search the public Snowcone catalog (t-shirts, hoodies, mugs, \u2026). Returns matching products with their code (id), name, price_cents (suggested retail, USD cents), and placement/mockup counts. Use snowcone_get_product for the full placement/mockup/option detail needed to render.",
|
|
771
852
|
inputSchema: {
|
|
772
853
|
query: z.string().default("").describe("Search text. Empty string lists popular products."),
|
|
773
854
|
limit: z.number().int().min(1).max(50).default(10).describe("Max results (1-50)."),
|
|
@@ -898,7 +979,7 @@ server.registerTool(
|
|
|
898
979
|
"snowcone_render_mockup",
|
|
899
980
|
{
|
|
900
981
|
title: "Render a mockup URL",
|
|
901
|
-
description: "Build a public mockup IMAGE url for a product + your artwork + your shop. The result is an <img>-ready URL \u2014 no API call, no upload. Provide 'asset' (one image) OR 'design' (per-placement map). The asset must be a publicly-fetchable raster image (PNG/JPEG/WebP/AVIF; not SVG), and the product code must exist in the catalog. Pass shop_secret to get an L3-signed URL. By DEFAULT the server fetches the built URL and confirms it actually renders, so a bad product code, wrong placement key, or unusable asset comes back as a clear error instead of a confident-but-broken URL. Pass verify=false to skip that check and just get the URL string instantly.",
|
|
982
|
+
description: "Show the user their photo, design or text on a real product (t-shirt, mug, hoodie, tote, poster\u2026) as a photoreal preview image. Build a public mockup IMAGE url for a product + your artwork + your shop. The result is an <img>-ready URL \u2014 no API call, no upload. Provide 'asset' (one image) OR 'design' (per-placement map). The asset must be a publicly-fetchable raster image (PNG/JPEG/WebP/AVIF; not SVG), and the product code must exist in the catalog. Pass shop_secret to get an L3-signed URL. By DEFAULT the server fetches the built URL and confirms it actually renders, so a bad product code, wrong placement key, or unusable asset comes back as a clear error instead of a confident-but-broken URL. Pass verify=false to skip that check and just get the URL string instantly.",
|
|
902
983
|
inputSchema: {
|
|
903
984
|
...urlShape,
|
|
904
985
|
verify: z.boolean().optional().describe(
|
|
@@ -955,7 +1036,7 @@ server.registerTool(
|
|
|
955
1036
|
"snowcone_buy_url",
|
|
956
1037
|
{
|
|
957
1038
|
title: "Build a checkout URL",
|
|
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.",
|
|
1039
|
+
description: "Give the user a link to buy the printed product they just previewed \u2014 it's printed and shipped to them. 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.",
|
|
959
1040
|
inputSchema: {
|
|
960
1041
|
...urlShape,
|
|
961
1042
|
verify: z.boolean().optional().describe(
|
|
@@ -994,6 +1075,87 @@ server.registerTool(
|
|
|
994
1075
|
}
|
|
995
1076
|
}
|
|
996
1077
|
);
|
|
1078
|
+
server.registerTool(
|
|
1079
|
+
"snowcone_get_quote",
|
|
1080
|
+
{
|
|
1081
|
+
title: "Get the price, shipping and delivery",
|
|
1082
|
+
description: "Tell the user what a printed product costs and when it would arrive, before they buy. Returns the price the buy link will charge (before tax), and each shipping option with its cost and delivery estimate for where it's going. Takes the same product and options as snowcone_buy_url; no artwork or shop needed. Nothing is created or charged. Only promise what comes back: an option with no estimated_delivery means we have no date for it yet.",
|
|
1083
|
+
inputSchema: {
|
|
1084
|
+
product: z.string().min(1).describe("Product code (the catalog document id), e.g. 'BEEB77'."),
|
|
1085
|
+
options: z.record(z.string()).optional().describe("Variant option picks: attribute \u2192 choice, e.g. { size: 'M', color: 'black' }. The price depends on these."),
|
|
1086
|
+
quantity: z.number().int().min(1).max(100).optional().describe("How many (1 to 100). Default 1."),
|
|
1087
|
+
ship_to: z.string().length(2).optional().describe("2-letter destination country, e.g. 'US'. Default US. A country we can't ship to returns an error listing the ones we can.")
|
|
1088
|
+
},
|
|
1089
|
+
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true }
|
|
1090
|
+
},
|
|
1091
|
+
async (args) => {
|
|
1092
|
+
try {
|
|
1093
|
+
const q = await getQuote({
|
|
1094
|
+
product: args.product,
|
|
1095
|
+
...args.options ? { options: args.options } : {},
|
|
1096
|
+
...args.quantity !== void 0 ? { quantity: args.quantity } : {},
|
|
1097
|
+
...args.ship_to !== void 0 ? { shipTo: args.ship_to } : {}
|
|
1098
|
+
});
|
|
1099
|
+
return ok(
|
|
1100
|
+
{
|
|
1101
|
+
product: q.product,
|
|
1102
|
+
variant_id: q.variantId,
|
|
1103
|
+
variant_label: q.variantLabel,
|
|
1104
|
+
quantity: q.quantity,
|
|
1105
|
+
currency: q.currency,
|
|
1106
|
+
unit_price_cents: q.unitPriceCents,
|
|
1107
|
+
items_total_cents: q.itemsTotalCents,
|
|
1108
|
+
tax_included: q.taxIncluded,
|
|
1109
|
+
ship_to: q.shipTo,
|
|
1110
|
+
shipping: q.shipping.map((s) => ({
|
|
1111
|
+
speed: s.speed,
|
|
1112
|
+
price_cents: s.priceCents,
|
|
1113
|
+
...s.minTransitDays !== void 0 ? { min_transit_days: s.minTransitDays } : {},
|
|
1114
|
+
...s.maxTransitDays !== void 0 ? { max_transit_days: s.maxTransitDays } : {},
|
|
1115
|
+
...s.estimatedDelivery ? { estimated_delivery: s.estimatedDelivery } : {}
|
|
1116
|
+
})),
|
|
1117
|
+
quoted_at: q.quotedAt
|
|
1118
|
+
},
|
|
1119
|
+
quoteText(q)
|
|
1120
|
+
);
|
|
1121
|
+
} catch (err) {
|
|
1122
|
+
return fail(formatError(err));
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1125
|
+
);
|
|
1126
|
+
server.registerTool(
|
|
1127
|
+
"snowcone_get_order_status",
|
|
1128
|
+
{
|
|
1129
|
+
title: "Find out where an order is",
|
|
1130
|
+
description: "Tell the user where their order is: whether it's being made or on its way, the carrier and tracking number, and the latest scan. Ask them for the order number and the email from their order confirmation. Read-only. If nothing matches, the error doesn't say which of the two was wrong, and repeated tries are limited, so check both with the person before retrying.",
|
|
1131
|
+
inputSchema: {
|
|
1132
|
+
order_number: z.string().min(1).describe("The order number from the confirmation email, e.g. '8532-5134'."),
|
|
1133
|
+
email: z.string().min(3).describe("The email the order was placed with.")
|
|
1134
|
+
},
|
|
1135
|
+
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true }
|
|
1136
|
+
},
|
|
1137
|
+
async (args) => {
|
|
1138
|
+
try {
|
|
1139
|
+
const r = await getOrderStatus({ orderNumber: args.order_number, email: args.email });
|
|
1140
|
+
return ok(
|
|
1141
|
+
{
|
|
1142
|
+
order_number: r.order.order.number,
|
|
1143
|
+
placed_at: r.order.order.placedAt,
|
|
1144
|
+
status: r.order.status,
|
|
1145
|
+
headline: r.order.headline,
|
|
1146
|
+
stages: r.order.stages,
|
|
1147
|
+
packages: r.order.packages,
|
|
1148
|
+
events: r.order.events,
|
|
1149
|
+
items: r.order.items,
|
|
1150
|
+
status_url: r.statusUrl
|
|
1151
|
+
},
|
|
1152
|
+
orderStatusText(r)
|
|
1153
|
+
);
|
|
1154
|
+
} catch (err) {
|
|
1155
|
+
return fail(formatError(err));
|
|
1156
|
+
}
|
|
1157
|
+
}
|
|
1158
|
+
);
|
|
997
1159
|
|
|
998
1160
|
// src/index.ts
|
|
999
1161
|
async function main() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@snowcone-app/mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"mcpName": "io.github.snowcone-app/snowcone",
|
|
5
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.",
|
|
6
6
|
"keywords": [
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"CHANGELOG.md"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
38
|
+
"@modelcontextprotocol/sdk": "^1.32.2",
|
|
39
39
|
"zod": "^3.23.8"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"tsup": "^8.1.0",
|
|
44
44
|
"typescript": "^5.5.4",
|
|
45
45
|
"vitest": "^2.1.9",
|
|
46
|
-
"@snowcone-app/mockup-url": "0.
|
|
46
|
+
"@snowcone-app/mockup-url": "0.6.0"
|
|
47
47
|
},
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"access": "public"
|