Skip to main content
Glama
hungryweb

CS-Cart MCP Server

by hungryweb

update_product_stock

Adjust product stock quantity in CS-Cart by specifying the product ID and new stock amount. Simplifies inventory management for e-commerce stores.

Instructions

Update product stock quantity

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
amountYesNew stock quantity
product_idYesProduct ID

Implementation Reference

  • The handler function that updates the product stock by making a PUT request to the CS-Cart API endpoint `/products/{product_id}` with the new amount.
    async updateProductStock(args) { const productData = { amount: args.amount }; const result = await this.makeRequest('PUT', `/products/${args.product_id}`, productData); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
  • Input schema defining the parameters for the update_product_stock tool: product_id (number, required) and amount (number, required).
    inputSchema: { type: 'object', properties: { product_id: { type: 'number', description: 'Product ID', }, amount: { type: 'number', description: 'New stock quantity', }, }, required: ['product_id', 'amount'], },
  • src/index.js:206-222 (registration)
    Tool registration in the ListTools response, including name, description, and input schema.
    name: 'update_product_stock', description: 'Update product stock quantity', inputSchema: { type: 'object', properties: { product_id: { type: 'number', description: 'Product ID', }, amount: { type: 'number', description: 'New stock quantity', }, }, required: ['product_id', 'amount'], }, },
  • src/index.js:400-401 (registration)
    Dispatch case in the CallToolRequest handler that routes to the updateProductStock method.
    case 'update_product_stock': return await this.updateProductStock(args);

Other Tools

Related Tools

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