Skip to main content
Glama
hungryweb

CS-Cart MCP Server

by hungryweb

get_categories

Retrieve product categories from CS-Cart stores to organize inventory, filter by parent category and status for efficient catalog management.

Instructions

Get list of product categories

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
parent_idNoParent category ID (0 for root categories)
statusNoCategory status filter (A=Active, D=Disabled, H=Hidden)

Implementation Reference

  • The core handler function for the 'get_categories' tool. Constructs URLSearchParams from input arguments (parent_id and status), builds the /categories endpoint, calls the shared makeRequest('GET'), and returns the API response as formatted JSON text content.
    async getCategories(args) {
      const params = new URLSearchParams();
      
      if (args.parent_id !== undefined) params.append('parent_id', args.parent_id.toString());
      if (args.status) params.append('status', args.status);
    
      const queryString = params.toString();
      const endpoint = `/categories${queryString ? `?${queryString}` : ''}`;
      
      const result = await this.makeRequest('GET', endpoint);
      return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
    }
  • src/index.js:226-243 (registration)
    Tool registration in the ListToolsRequestSchema handler's tools array, defining the name, description, and inputSchema for get_categories.
      name: 'get_categories',
      description: 'Get list of product categories',
      inputSchema: {
        type: 'object',
        properties: {
          parent_id: {
            type: 'number',
            description: 'Parent category ID (0 for root categories)',
            default: 0,
          },
          status: {
            type: 'string',
            description: 'Category status filter (A=Active, D=Disabled, H=Hidden)',
            enum: ['A', 'D', 'H'],
          },
        },
      },
    },
  • src/index.js:402-403 (registration)
    Dispatch case in the CallToolRequestSchema switch statement that calls the getCategories handler for this tool.
    case 'get_categories':
      return await this.getCategories(args);
  • Input schema defining optional parameters: parent_id (number, default 0) and status (string enum ['A','D','H']).
    inputSchema: {
      type: 'object',
      properties: {
        parent_id: {
          type: 'number',
          description: 'Parent category ID (0 for root categories)',
          default: 0,
        },
        status: {
          type: 'string',
          description: 'Category status filter (A=Active, D=Disabled, H=Hidden)',
          enum: ['A', 'D', 'H'],
        },
      },
    },
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. It states the tool retrieves a list but doesn't describe what kind of list (e.g., paginated, sorted, limited), whether it requires authentication, rate limits, or error conditions. For a read operation with zero annotation coverage, this leaves significant behavioral gaps.

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 with zero waste. It's appropriately sized for a simple list-retrieval tool and front-loads the core purpose immediately. Every word earns its place.

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

Completeness3/5

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

Given the tool's moderate complexity (2 parameters, no output schema, no annotations), the description is minimally adequate. It states what the tool does but lacks behavioral context, usage guidance, and output information. For a read-only tool with good schema coverage, this is the bare minimum.

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?

The schema has 100% description coverage, with both parameters clearly documented in the schema itself. The description adds no additional parameter information beyond what's already in the schema (e.g., it doesn't explain the relationship between parent_id and category hierarchy). Baseline 3 is appropriate when the schema does the heavy lifting.

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 ('Get list') and resource ('product categories'), providing a specific verb+resource combination. However, it doesn't distinguish this tool from sibling tools like 'get_products' or 'get_product', which also retrieve product-related information but focus on different resources.

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. It doesn't mention when this tool is appropriate (e.g., for browsing categories vs. products) or when to use sibling tools like 'get_products' instead. There's no context about prerequisites or exclusions.

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