delete_product
Remove a product from the ShipStation system by specifying the product ID to manage inventory and product listings effectively.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| productId | Yes | Product ID to delete |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"productId": {
"description": "Product ID to delete",
"type": "number"
}
},
"required": [
"productId"
],
"type": "object"
}
Implementation Reference
- src/tools/product-tools.js:101-113 (handler)The handler function for the 'delete_product' MCP tool. It calls shipStationClient.deleteProduct(productId), formats the JSON response, and handles errors by returning an error message.handler: async ({ productId }) => { try { const result = await shipStationClient.deleteProduct(productId); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: error.message }], isError: true }; } }
- src/tools/product-tools.js:98-100 (schema)Zod input schema for the 'delete_product' tool, requiring a numeric 'productId' parameter.schema: { productId: z.number().describe("Product ID to delete") },
- src/server.js:174-191 (registration)Registration code that spreads the productTools array (containing 'delete_product') and registers each tool with the MCP server using server.tool().[ ...orderTools, ...shipmentTools, ...carrierTools, ...warehouseTools, ...productTools, ...customerTools, ...storeTools, ...webhookTools, ...fulfillmentTools ].forEach(tool => { server.tool( tool.name, tool.schema, tool.handler, { description: tool.description } ); });
- src/api-client.js:152-154 (helper)ShipStationClient helper method that sends a DELETE request to the ShipStation API endpoint `/products/${productId}` to delete the product.async deleteProduct(productId) { return this.request('DELETE', `/products/${productId}`); }