delete_product
Remove products from your CS-Cart store by specifying the product ID. This tool simplifies product management, ensuring accurate inventory updates and store optimization.
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 main handler function that executes the delete_product tool by sending a DELETE request to the CS-Cart API endpoint `/products/{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:194-203 (schema)Input schema definition for the delete_product tool, specifying that a numeric product_id is required.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 handler switch statement that routes delete_product calls to the deleteProduct method.case 'delete_product': return await this.deleteProduct(args);
- src/index.js:191-204 (registration)Tool registration in the ListToolsRequestSchema response, including name, description, and input schema.{ 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'], }, },