Skip to main content
Glama
hungryweb

CS-Cart MCP Server

by hungryweb

create_product

Add new products to your CS-Cart store by specifying name, price, categories, and inventory details to expand your online catalog.

Instructions

Create a new product in the CS-Cart store

Input Schema

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

Implementation Reference

  • The main handler function for the 'create_product' tool. It makes a POST request to the CS-Cart API endpoint '/products' using the provided arguments and returns the formatted API response.
    async createProduct(args) {
      const result = await this.makeRequest('POST', '/products', args);
      return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
    }
  • Input schema defining the parameters, types, descriptions, defaults, and required fields for the 'create_product' tool.
    inputSchema: {
      type: 'object',
      properties: {
        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'],
          default: 'A',
        },
        amount: {
          type: 'number',
          description: 'Product quantity in stock',
          default: 0,
        },
        weight: {
          type: 'number',
          description: 'Product weight',
        },
        shipping_freight: {
          type: 'number',
          description: 'Shipping cost',
        },
      },
      required: ['product', 'price'],
    },
  • src/index.js:394-395 (registration)
    Registration/dispatch in the CallToolRequest handler switch statement that routes calls to the createProduct handler method.
    case 'create_product':
      return await this.createProduct(args);
  • src/index.js:89-138 (registration)
    Tool registration in the ListToolsRequest response, including name, description, and reference to input schema.
    {
      name: 'create_product',
      description: 'Create a new product in the CS-Cart store',
      inputSchema: {
        type: 'object',
        properties: {
          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'],
            default: 'A',
          },
          amount: {
            type: 'number',
            description: 'Product quantity in stock',
            default: 0,
          },
          weight: {
            type: 'number',
            description: 'Product weight',
          },
          shipping_freight: {
            type: 'number',
            description: 'Shipping cost',
          },
        },
        required: ['product', 'price'],
      },
    },
  • Shared helper method used by createProduct (and other tools) 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 but only states the basic action. It doesn't cover critical aspects like required permissions, whether creation is idempotent, error handling, or what happens on success (e.g., returns a product ID). For a mutation tool with zero annotation coverage, this is a significant gap.

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 a single, efficient sentence that directly states the tool's purpose without any fluff or redundancy. It's appropriately sized and front-loaded, making it easy for an agent to parse quickly.

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 creation tool with 9 parameters, no annotations, and no output schema, the description is inadequate. It doesn't explain what the tool returns, error conditions, or behavioral nuances, leaving the agent with insufficient context to use it effectively beyond basic parameter passing.

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 9 parameters with clear descriptions and defaults. The description adds no additional parameter semantics beyond implying creation involves these fields, meeting the baseline for high schema coverage without compensation needed.

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

Purpose4/5

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

The description clearly states the action ('Create') and target resource ('new product in the CS-Cart store'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'update_product' beyond the obvious verb difference, missing an opportunity to clarify when to choose creation over modification.

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?

The description provides no guidance on when to use this tool versus alternatives like 'update_product' or 'get_products'. There's no mention of prerequisites, context for creation, or exclusions, leaving the agent to infer usage solely from the tool name and schema.

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