delete_product
Remove a product from your CS-Cart store by specifying its product ID to manage inventory and keep your catalog current.
Instructions
Delete a product from the store
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| product_id | Yes | Product ID to delete |
Implementation Reference
- src/index.js:475-478 (handler)The handler function that executes the delete_product tool. It sends a DELETE request to the CS-Cart API for the specified product_id and returns the response.async deleteProduct(args) { const result = await this.makeRequest('DELETE', `/products/${args.product_id}`); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
- src/index.js:191-204 (schema)The tool's schema definition, including name, description, and input schema requiring a product_id.{ name: 'delete_product', description: 'Delete a product from the store', inputSchema: { type: 'object', properties: { product_id: { type: 'number', description: 'Product ID to delete', }, }, required: ['product_id'], }, },
- src/index.js:398-399 (registration)Registration in the CallToolRequestSchema switch statement that routes calls to delete_product to the deleteProduct handler method.case 'delete_product': return await this.deleteProduct(args);