Skip to main content
Glama
hungryweb

CS-Cart MCP Server

by hungryweb

update_product

Modify product details in CS-Cart MCP Server, including name, price, description, stock, and status, by specifying the product ID and desired updates.

Instructions

Update an existing product

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
amountNoProduct quantity in stock
category_idsNoArray of category IDs
descriptionNoProduct description
full_descriptionNoFull product description
priceNoProduct price
productNoProduct name
product_idYesProduct ID to update
shipping_freightNoShipping cost
statusNoProduct status (A=Active, D=Disabled, H=Hidden)
weightNoProduct weight

Implementation Reference

  • The handler function for the 'update_product' tool. It extracts the product_id and spreads the remaining args as productData, then makes a PUT request to the CS-Cart API endpoint `/products/${product_id}` with the productData, and returns the JSON-stringified result.
    async updateProduct(args) { const { product_id, ...productData } = args; const result = await this.makeRequest('PUT', `/products/${product_id}`, productData); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
  • The tool schema registration in ListToolsRequestSchema, including name, description, and detailed inputSchema with properties for updating product fields and required product_id.
    { name: 'update_product', description: 'Update an existing product', inputSchema: { type: 'object', properties: { product_id: { type: 'number', description: 'Product ID to update', }, product: { type: 'string', description: 'Product name', }, price: { type: 'number', description: 'Product price', }, category_ids: { type: 'array', items: { type: 'number' }, description: 'Array of category IDs', }, description: { type: 'string', description: 'Product description', }, full_description: { type: 'string', description: 'Full product description', }, status: { type: 'string', description: 'Product status (A=Active, D=Disabled, H=Hidden)', enum: ['A', 'D', 'H'], }, amount: { type: 'number', description: 'Product quantity in stock', }, weight: { type: 'number', description: 'Product weight', }, shipping_freight: { type: 'number', description: 'Shipping cost', }, }, required: ['product_id'], }, },
  • src/index.js:396-397 (registration)
    The switch case in CallToolRequestSchema handler that dispatches to the updateProduct method when 'update_product' tool is called.
    case 'update_product': return await this.updateProduct(args);

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hungryweb/cscart-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server