Skip to main content
Glama
hungryweb

CS-Cart MCP Server

by hungryweb

update_product_stock

Modify inventory levels for products in CS-Cart stores by specifying product ID and new quantity to maintain accurate stock counts.

Instructions

Update product stock quantity

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
product_idYesProduct ID
amountYesNew stock quantity

Implementation Reference

  • The handler function for 'update_product_stock' that updates the stock quantity of a product by making a PUT request to the CS-Cart API 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) }] }; }
  • Defines the tool schema including name, description, and input schema for validating arguments (product_id and amount).
    { 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)
    Registers the tool handler in the CallToolRequestSchema switch statement, dispatching calls to updateProductStock.
    case 'update_product_stock': return await this.updateProductStock(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