Skip to main content
Glama
hungryweb

CS-Cart MCP Server

by hungryweb

update_product

Modify product details in CS-Cart stores by updating name, price, stock, description, categories, or status using product ID.

Instructions

Update an existing product

Input Schema

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

Implementation Reference

  • Executes the update_product tool by sending a PUT request to the CS-Cart API with the provided product data, excluding product_id which is used in the URL.
    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) }] };
    }
  • Input schema defining the parameters for the update_product tool, requiring product_id and allowing updates to various product fields.
    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)
    Switch case in the CallToolRequestSchema handler that routes 'update_product' calls to the updateProduct method.
    case 'update_product':
      return await this.updateProduct(args);
  • src/index.js:139-190 (registration)
    Tool registration in the ListToolsRequestSchema response, defining name, description, and input schema for update_product.
    {
      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'],
      },
    },
  • Helper method used by the updateProduct handler to make authenticated API requests to the CS-Cart server.
    async makeRequest(method, endpoint, data = null) {
      const config = {
        method,
        url: `${process.env.CSCART_API_URL}${endpoint}`,
        headers: {
          'Content-Type': 'application/json',
          'Authorization': `Basic ${Buffer.from(`${process.env.CSCART_API_EMAIL}:${process.env.CSCART_API_KEY}`).toString('base64')}`,
        },
      };
    
      if (data) {
        config.data = data;
      }
    
      const response = await axios(config);
      return response.data;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. 'Update an existing product' implies a mutation operation but doesn't disclose permission requirements, whether updates are partial or complete, validation rules, error conditions, or what happens to unspecified fields. This leaves significant behavioral gaps for a tool with 10 parameters.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise at just 4 words with zero wasted language. It's front-loaded with the core action and resource, making it efficient despite its simplicity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with 10 parameters, no annotations, and no output schema, the description is inadequate. It doesn't explain what happens during updates, what the response contains, error handling, or how it differs from similar tools. The 100% schema coverage helps but doesn't compensate for the lack of behavioral context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all 10 parameters thoroughly. The description adds no additional parameter information beyond what's in the schema, maintaining the baseline score of 3 for adequate but unenhanced coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Update an existing product' clearly states the verb (update) and resource (product), but it's vague about scope and doesn't distinguish from sibling tools like update_product_stock or update_order_status. It doesn't specify what aspects of a product can be updated beyond the basic concept.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided about when to use this tool versus alternatives like update_product_stock or create_product. The description doesn't mention prerequisites (e.g., product must exist), exclusions, or appropriate contexts for use.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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-server'

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