bulkflow-mcp 1.1.0 → 1.2.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/index.js +26 -24
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -84,18 +84,19 @@ server.tool(
|
|
|
84
84
|
},
|
|
85
85
|
);
|
|
86
86
|
|
|
87
|
-
|
|
88
|
-
"
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
);
|
|
87
|
+
const GET_PRODUCTS_DESC =
|
|
88
|
+
"Get the actual sheet data (name, price, MOQ, variants, images) for every product in a job, regardless of review state and with no website connection needed. Use this whenever the user just wants the data/sheet from a finished job — it always works, unlike get_export_preview which needs an approved+connected website. Paginated — pass the returned nextCursor back in to get the next page.";
|
|
89
|
+
const GET_PRODUCTS_SCHEMA = { jobId: z.string(), cursor: z.string().optional(), limit: z.number().int().min(1).max(100).optional() };
|
|
90
|
+
const getProductsHandler = async ({ jobId, cursor, limit }) => {
|
|
91
|
+
const qs = new URLSearchParams();
|
|
92
|
+
if (cursor) qs.set("cursor", cursor);
|
|
93
|
+
if (limit) qs.set("limit", String(limit));
|
|
94
|
+
const r = await call("GET", `/api/mcp/v1/jobs/${encodeURIComponent(jobId)}/products?${qs}`);
|
|
95
|
+
return { content: [{ type: "text", text: JSON.stringify(r) }] };
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
server.tool("get_products", GET_PRODUCTS_DESC, GET_PRODUCTS_SCHEMA, getProductsHandler);
|
|
99
|
+
server.tool("list_products", "Alias of get_products. " + GET_PRODUCTS_DESC, GET_PRODUCTS_SCHEMA, getProductsHandler);
|
|
99
100
|
|
|
100
101
|
server.tool(
|
|
101
102
|
"list_projects",
|
|
@@ -139,18 +140,19 @@ server.tool(
|
|
|
139
140
|
},
|
|
140
141
|
);
|
|
141
142
|
|
|
142
|
-
|
|
143
|
-
"
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
);
|
|
143
|
+
const DOWNLOAD_SHEET_DESC =
|
|
144
|
+
"Export / download the job's Excel sheet. Returns a base64-encoded file inline (so it can be handed to the user directly in chat, no network fetch needed) plus a download link as a fallback. Use this for ANY request to export, download, or get the sheet/spreadsheet for a job. IMPORTANT: before calling this, ask the user which format they want from the `availableFormats` list returned by get_job_status — never pick one yourself.";
|
|
145
|
+
const DOWNLOAD_SHEET_SCHEMA = {
|
|
146
|
+
jobId: z.string(),
|
|
147
|
+
format: z.enum(["default", "importwale", "shopify", "flipkart"]).optional().describe("Which sheet format — defaults to BulkFlow's standard sheet"),
|
|
148
|
+
};
|
|
149
|
+
const downloadSheetHandler = async ({ jobId, format }) => {
|
|
150
|
+
const r = await downloadFile(jobId, format || "default");
|
|
151
|
+
return { content: [{ type: "text", text: JSON.stringify(r) }] };
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
server.tool("download_sheet", DOWNLOAD_SHEET_DESC, DOWNLOAD_SHEET_SCHEMA, downloadSheetHandler);
|
|
155
|
+
server.tool("export_sheet", "Alias of download_sheet. " + DOWNLOAD_SHEET_DESC, DOWNLOAD_SHEET_SCHEMA, downloadSheetHandler);
|
|
154
156
|
|
|
155
157
|
server.tool(
|
|
156
158
|
"list_needs_review",
|