Skip to main content
Glama
hungryweb

CS-Cart MCP Server

by hungryweb

get_products

Retrieve product listings from CS-Cart stores with pagination, filtering by status, category, or search query to manage inventory and display items.

Instructions

Retrieve a list of products from the CS-Cart store

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoPage number for pagination
items_per_pageNoNumber of items per page
statusNoProduct status filter (A=Active, D=Disabled, H=Hidden)
category_idNoFilter by category ID
qNoSearch query for product name

Implementation Reference

  • The handler function that executes the get_products tool. It constructs URL query parameters based on input arguments and makes a GET request to the CS-Cart /products API endpoint using the shared makeRequest helper.
    async getProducts(args) {
      const params = new URLSearchParams();
      
      if (args.page) params.append('page', args.page.toString());
      if (args.items_per_page) params.append('items_per_page', args.items_per_page.toString());
      if (args.status) params.append('status', args.status);
      if (args.category_id) params.append('cid', args.category_id.toString());
      if (args.q) params.append('q', args.q);
    
      const queryString = params.toString();
      const endpoint = `/products${queryString ? `?${queryString}` : ''}`;
      
      const result = await this.makeRequest('GET', endpoint);
      return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
    }
  • src/index.js:44-74 (registration)
    Registration of the get_products tool in the ListToolsRequestHandler, including its metadata and input schema definition.
      name: 'get_products',
      description: 'Retrieve a list of products from the CS-Cart store',
      inputSchema: {
        type: 'object',
        properties: {
          page: {
            type: 'number',
            description: 'Page number for pagination',
            default: 1,
          },
          items_per_page: {
            type: 'number',
            description: 'Number of items per page',
            default: 10,
          },
          status: {
            type: 'string',
            description: 'Product status filter (A=Active, D=Disabled, H=Hidden)',
            enum: ['A', 'D', 'H'],
          },
          category_id: {
            type: 'number',
            description: 'Filter by category ID',
          },
          q: {
            type: 'string',
            description: 'Search query for product name',
          },
        },
      },
    },
  • src/index.js:390-391 (registration)
    Dispatch/registration logic in the CallToolRequestHandler switch statement that routes calls to the getProducts handler.
    case 'get_products':
      return await this.getProducts(args);
  • Input schema definition for the get_products tool, specifying parameters for pagination, filtering, and search.
    inputSchema: {
      type: 'object',
      properties: {
        page: {
          type: 'number',
          description: 'Page number for pagination',
          default: 1,
        },
        items_per_page: {
          type: 'number',
          description: 'Number of items per page',
          default: 10,
        },
        status: {
          type: 'string',
          description: 'Product status filter (A=Active, D=Disabled, H=Hidden)',
          enum: ['A', 'D', 'H'],
        },
        category_id: {
          type: 'number',
          description: 'Filter by category ID',
        },
        q: {
          type: 'string',
          description: 'Search query for product name',
        },
      },
    },
  • Shared helper method used by getProducts (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 but only states it 'retrieves a list' without disclosing behavioral traits. It doesn't mention whether this is a read-only operation, if it requires authentication, rate limits, pagination behavior beyond parameters, or what format the returned list has. For a tool with 5 parameters and no annotation coverage, this is inadequate.

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 unnecessary words. It's appropriately sized for a basic retrieval tool and front-loads the essential information.

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 tool with 5 parameters, no annotations, and no output schema, the description is insufficiently complete. It doesn't explain the return format, error conditions, authentication requirements, or how it differs from similar sibling tools. The agent would lack important contextual information needed to use this tool effectively.

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 fully documents all 5 parameters with descriptions and defaults. The description adds no additional parameter information beyond what's in the schema, meeting the baseline for high schema coverage but not providing extra context about how parameters interact or typical usage patterns.

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 verb 'Retrieve' and resource 'list of products from the CS-Cart store', making the purpose unambiguous. However, it doesn't differentiate from sibling tools like 'get_product' (singular) or 'get_categories', which would require more specific scope information.

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 'get_product' (for single products) or 'get_categories' (for categories). There's no mention of prerequisites, typical use cases, or comparison with sibling tools.

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