update_product
Modify product details in ShipStation by providing product ID and updated data in JSON format to maintain accurate inventory and order information.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| productId | Yes | Product ID to update | |
| productData | Yes | JSON string containing the updated product data |
Implementation Reference
- src/tools/product-tools.js:80-93 (handler)MCP tool handler for 'update_product'. Parses the productData JSON string and calls the ShipStationClient.updateProduct method to perform the update, returning formatted JSON response or error.handler: async ({ productId, productData }) => { try { const parsedData = JSON.parse(productData); const result = await shipStationClient.updateProduct(productId, parsedData); 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:76-79 (schema)Zod schema defining the input parameters for the update_product tool: productId (number) and productData (string JSON).schema: { productId: z.number().describe("Product ID to update"), productData: z.string().describe("JSON string containing the updated product data") },
- src/tools/product-tools.js:74-75 (registration)Tool name and description registration within the productTools array.name: "update_product", description: "Update an existing product",
- src/api-client.js:148-150 (helper)ShipStationClient helper method that sends a PUT request to the ShipStation API endpoint `/products/{productId}` to update the product.async updateProduct(productId, data) { return this.request('PUT', `/products/${productId}`, data); }