create_product
Add new products to ShipBob's fulfillment system by defining essential details like name, SKU, barcode, dimensions, weight, and value. Required fields: name and SKU.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| barcode | No | Product barcode/UPC | |
| description | No | Product description | |
| height | No | Height in inches | |
| length | No | Length in inches | |
| name | Yes | Product name | |
| sku | Yes | Stock keeping unit (unique identifier) | |
| value | No | Declared value of the product | |
| weight | No | Weight in ounces | |
| width | No | Width in inches |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"barcode": {
"description": "Product barcode/UPC",
"type": "string"
},
"description": {
"description": "Product description",
"type": "string"
},
"height": {
"description": "Height in inches",
"type": "number"
},
"length": {
"description": "Length in inches",
"type": "number"
},
"name": {
"description": "Product name",
"type": "string"
},
"sku": {
"description": "Stock keeping unit (unique identifier)",
"type": "string"
},
"value": {
"description": "Declared value of the product",
"type": "number"
},
"weight": {
"description": "Weight in ounces",
"type": "number"
},
"width": {
"description": "Width in inches",
"type": "number"
}
},
"required": [
"name",
"sku"
],
"type": "object"
}
Implementation Reference
- src/tools/product-tools.js:68-83 (handler)Handler function for the 'create_product' MCP tool. It invokes the ShipBob API via shipbobClient.createProduct and returns a formatted success or error response.handler: async (productData) => { try { const newProduct = await shipbobClient.createProduct(productData); return { content: [{ type: "text", text: `Product created successfully: ${JSON.stringify(newProduct, null, 2)}` }] }; } catch (error) { return { content: [{ type: "text", text: `Error creating product: ${error.message}` }], isError: true }; } }
- src/tools/product-tools.js:57-67 (schema)Zod schema defining the input parameters for the create_product tool.schema: { name: z.string().describe("Product name"), sku: z.string().describe("Stock keeping unit (unique identifier)"), barcode: z.string().optional().describe("Product barcode/UPC"), description: z.string().optional().describe("Product description"), weight: z.number().optional().describe("Weight in ounces"), length: z.number().optional().describe("Length in inches"), width: z.number().optional().describe("Width in inches"), height: z.number().optional().describe("Height in inches"), value: z.number().optional().describe("Declared value of the product") },
- src/server.js:50-50 (registration)Call to register the productTools array (which includes the create_product tool) with the MCP server.registerTools(productTools);
- src/api-client.js:63-65 (helper)ShipBobClient.createProduct helper method that performs the actual POST API request to create a product.async createProduct(productData) { return this.request('POST', '/products', productData); }