create_product
Create and manage product details in the ShipStation API by submitting product data as a JSON string through the MCP server. Streamline inventory and order management.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| productData | Yes | JSON string containing the product data |
Implementation Reference
- src/tools/product-tools.js:58-71 (handler)The handler function for the "create_product" MCP tool. Parses the input JSON string and delegates to the ShipStation API client, returning formatted result or error.handler: async ({ productData }) => { try { const parsedData = JSON.parse(productData); const result = await shipStationClient.createProduct(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:55-57 (schema)Zod input schema for the "create_product" tool, expecting a JSON string of product data.schema: { productData: z.string().describe("JSON string containing the product data") },
- src/server.js:184-191 (registration)Registration of all tools including "create_product" via server.tool calls in a loop over spread tool arrays (productTools contains create_product).].forEach(tool => { server.tool( tool.name, tool.schema, tool.handler, { description: tool.description } ); });
- src/api-client.js:144-146 (helper)ShipStationClient helper method that performs the actual POST request to /products endpoint.async createProduct(data) { return this.request('POST', '/products', data); }