get_batch_status
Retrieve the status of a catalog batch operation by providing catalog ID and handle, to monitor completion or errors.
Instructions
Check the status of a catalog batch operation.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| catalog_id | Yes | Product catalog ID | |
| handle | Yes | Batch handle returned from batch_products |
Implementation Reference
- src/tools/catalogs.ts:242-257 (registration)Registration of the 'get_batch_status' tool via server.tool(), binding the handler to MCP.
server.tool( "get_batch_status", "Check the status of a catalog batch operation.", { catalog_id: z.string().describe("Product catalog ID"), handle: z.string().describe("Batch handle returned from batch_products"), }, async ({ catalog_id, handle }) => { try { const { data, rateLimit } = await client.get(`/${catalog_id}/check_batch_request_status`, { handle }); return { content: [{ type: "text" as const, text: JSON.stringify({ ...data as object, _rateLimit: rateLimit }, null, 2) }] }; } catch (error) { return { content: [{ type: "text" as const, text: `Failed: ${error instanceof Error ? error.message : String(error)}` }], isError: true }; } } ); - src/tools/catalogs.ts:249-256 (handler)Handler function that calls client.get('/{catalog_id}/check_batch_request_status') and returns the batch request status.
async ({ catalog_id, handle }) => { try { const { data, rateLimit } = await client.get(`/${catalog_id}/check_batch_request_status`, { handle }); return { content: [{ type: "text" as const, text: JSON.stringify({ ...data as object, _rateLimit: rateLimit }, null, 2) }] }; } catch (error) { return { content: [{ type: "text" as const, text: `Failed: ${error instanceof Error ? error.message : String(error)}` }], isError: true }; } } - src/tools/catalogs.ts:245-248 (schema)Input schema with catalog_id (string) and handle (string) parameters defined using Zod.
{ catalog_id: z.string().describe("Product catalog ID"), handle: z.string().describe("Batch handle returned from batch_products"), },