@solumflow-app/crm-mcp-server 0.6.0 → 0.7.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/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
6
6
  import { createClient } from "@solumflow-app/crm-client";
7
7
 
8
8
  // package.json
9
- var version = "0.6.0";
9
+ var version = "0.7.0";
10
10
 
11
11
  // src/catalog-migration-tools.ts
12
12
  import { z as z4 } from "zod";
@@ -38,6 +38,11 @@ var CatalogFieldSlugSchema = z.string().max(63).regex(FIELD_SLUG, {
38
38
  )
39
39
  });
40
40
  var cents = z.number().int().min(0).max(MAX_AMOUNT_CENTS);
41
+ var CatalogCategoryPlacementSchema = z.object({
42
+ slug: CatalogWebSlugSchema,
43
+ /** Lowest first; equal places stand in id order. */
44
+ position: z.number().int().min(-1e6).max(1e6).optional()
45
+ }).strict();
41
46
  var text = (max) => z.string().trim().max(max).nullable().optional();
42
47
  var CatalogPriceSchema = z.object({
43
48
  /** The price's own id at the source, so a renamed price stays itself. */
@@ -199,8 +204,13 @@ var CatalogProductUpsertSchema = z.object({
199
204
  socialTitle: text(300),
200
205
  socialDescription: text(1e3),
201
206
  socialImage: CatalogFileRefSchema.nullable().optional(),
202
- /** Replaces the product's categories, by slug. */
203
- categories: z.array(CatalogWebSlugSchema).max(50).optional(),
207
+ /**
208
+ * Replaces the product's categories, by slug, the first one leading. An
209
+ * entry may be `{ slug, position }` instead, to also set where the
210
+ * product stands on that category's page (`?sort=position`, lowest
211
+ * first); a plain slug leaves a stored place as it is.
212
+ */
213
+ categories: z.array(z.union([CatalogWebSlugSchema, CatalogCategoryPlacementSchema])).max(50).optional(),
204
214
  /**
205
215
  * Make a category that does not exist yet instead of refusing. Off unless
206
216
  * asked for, so a typo cannot become a category on a customer's website.
@@ -589,7 +599,7 @@ function registerCatalogTools(server, client) {
589
599
  "get_product",
590
600
  {
591
601
  title: "Read one product",
592
- description: "One product as its page needs it: name, prices, pictures, categories, variants and `fields`, keyed by field slug. Published products only unless you pass `status` (needs catalog:write), and a published one may be a minute old: to read back exactly what you just wrote, use get_product_by_ref. Answers that it is not found for an unknown product, or one not in the status asked. " + CONTENT_BLOCKS,
602
+ description: "One product as its page needs it: name, prices, pictures, categories, variants and `fields`, keyed by field slug. Published products only unless you pass `status` (needs a server key), and a published one may be a minute old: to read back exactly what you just wrote, use get_product_by_ref. Answers that it is not found for an unknown product, or one not in the status asked. " + CONTENT_BLOCKS,
593
603
  inputSchema: { slugOrId, currency, status: productStatus },
594
604
  annotations: { readOnlyHint: true, idempotentHint: true }
595
605
  },
@@ -619,7 +629,7 @@ function registerCatalogTools(server, client) {
619
629
  "list_products",
620
630
  {
621
631
  title: "List the products",
622
- description: "One page of the catalogue: name, address (slug), lowest price, whether it is in stock, its first picture and the public fields a listing shows. Narrow it to one category\u2019s whole branch by its id or address, or by the reference upsert_category recorded (`categorySource` + `categoryRef`), to one catalogue by the slug of its object, or to the product carrying an article number (`sku`). Read get_product for everything a product page needs. Published products only, and may be a minute old; `status` lists concepts, scheduled and archived ones too (needs catalog:write).",
632
+ description: "One page of the catalogue: name, address (slug), lowest price, whether it is in stock, its first picture and the public fields a listing shows. Narrow it to one category\u2019s whole branch by its id or address, or by the reference upsert_category recorded (`categorySource` + `categoryRef`), to one catalogue by the slug of its object, or to the product carrying an article number (`sku`). Read get_product for everything a product page needs. Published products only, and may be a minute old; `status` lists concepts, scheduled and archived ones too (needs a server key). `sort` orders the published ones: -publishedAt (newest first, the default), publishedAt, name, or position -- the seller\u2019s own order on the page of `category`, which it needs. Each item carries `sku`, `publishedAt` and `stockQuantity` (null when not counted).",
623
633
  inputSchema: {
624
634
  ...page,
625
635
  category: z3.string().regex(
@@ -636,7 +646,10 @@ function registerCatalogTools(server, client) {
636
646
  'One catalogue, by the slug of its object, such as "product".'
637
647
  ),
638
648
  currency,
639
- status: productStatus
649
+ status: productStatus,
650
+ sort: z3.enum(["-publishedAt", "publishedAt", "name", "position"]).optional().describe(
651
+ "The order: newest first by default; position needs `category`."
652
+ )
640
653
  },
641
654
  annotations: { readOnlyHint: true, idempotentHint: true }
642
655
  },
@@ -664,7 +677,7 @@ function registerCatalogTools(server, client) {
664
677
  "list_categories",
665
678
  {
666
679
  title: "List the categories",
667
- description: 'The categories of the catalogue, each with its path from the top and how many products are in it. Left without `parent`, every category comes back, which is what building a menu in one go needs; "root" asks for the top level, a category id for its children. Published categories only unless you pass `status` (draft or all, needs catalog:write).',
680
+ description: 'The categories of the catalogue, each with its path from the top and how many products are in it. Left without `parent`, every category comes back, which is what building a menu in one go needs; "root" asks for the top level, a category id for its children. Published categories only unless you pass `status` (draft or all, needs a server key).',
668
681
  inputSchema: {
669
682
  ...page,
670
683
  parent: z3.union([z3.literal("root"), z3.string().uuid()]).optional().describe('"root" or the id of a category.'),
@@ -688,7 +701,7 @@ function registerCatalogTools(server, client) {
688
701
  "get_category",
689
702
  {
690
703
  title: "Read one category page",
691
- description: "One category as its page needs it: name, description, the texts for search engines and social media, and the first page of its products. Pass the nextCursor back to page through the products. A category that is not on the website yet needs `status` (draft or all, catalog:write); its products are the published ones.",
704
+ description: "One category as its page needs it: name, description, the texts for search engines and social media, and the first page of its products. Pass the nextCursor back to page through the products. A category that is not on the website yet needs `status` (draft or all, a server key); its products are the published ones.",
692
705
  inputSchema: {
693
706
  slugOrId: z3.string().min(1).max(200).describe("The address (slug) or the id of the category."),
694
707
  ...page,
@@ -949,7 +962,7 @@ function registerCatalogMigrationTools(server, client) {
949
962
  "get_category_by_ref",
950
963
  {
951
964
  title: "Find a category by its reference",
952
- description: 'The category upsert_category recorded with this `source` and `externalRef` -- the id of a series in your own system -- also after its address was changed in the app. A published category unless you pass `status`: "draft" finds a concept or scheduled one, "all" any (needs catalog:write).',
965
+ description: 'The category upsert_category recorded with this `source` and `externalRef` -- the id of a series in your own system -- also after its address was changed in the app. A published category unless you pass `status`: "draft" finds a concept or scheduled one, "all" any (needs a server key).',
953
966
  inputSchema: {
954
967
  source: CatalogSourceSchema,
955
968
  externalRef: CatalogExternalRefSchema,