Skip to main content
Glama
hungryweb

CS-Cart MCP Server

by hungryweb

get_users

Retrieve and filter user accounts from CS-Cart stores to manage customers, vendors, and administrators with pagination and status controls.

Instructions

Get list of users/customers

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoPage number for pagination
items_per_pageNoNumber of items per page
statusNoUser status filter (A=Active, D=Disabled)
user_typeNoUser type filter (A=Admin, V=Vendor, C=Customer)

Implementation Reference

  • Implements the core logic of the get_users tool: builds query parameters from input arguments (page, items_per_page, status, user_type) and performs a GET request to the CS-Cart /users API endpoint via makeRequest helper, returning the result as formatted JSON text.
    async getUsers(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.user_type) params.append('user_type', args.user_type);
    
      const queryString = params.toString();
      const endpoint = `/users${queryString ? `?${queryString}` : ''}`;
      
      const result = await this.makeRequest('GET', endpoint);
      return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
    }
  • Defines the input schema for the get_users tool, specifying properties for pagination (page, items_per_page), filtering by status (A/D) and user_type (A/V/C).
    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: 'User status filter (A=Active, D=Disabled)',
          enum: ['A', 'D'],
        },
        user_type: {
          type: 'string',
          description: 'User type filter (A=Admin, V=Vendor, C=Customer)',
          enum: ['A', 'V', 'C'],
        },
      },
    },
  • src/index.js:327-355 (registration)
    Registers the get_users tool in the ListTools response, including its name, description, and full input schema.
    {
      name: 'get_users',
      description: 'Get list of users/customers',
      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: 'User status filter (A=Active, D=Disabled)',
            enum: ['A', 'D'],
          },
          user_type: {
            type: 'string',
            description: 'User type filter (A=Admin, V=Vendor, C=Customer)',
            enum: ['A', 'V', 'C'],
          },
        },
      },
    },
  • src/index.js:410-411 (registration)
    In the CallToolRequest handler switch statement, routes 'get_users' calls to the getUsers method.
    case 'get_users':
      return await this.getUsers(args);
  • Shared helper method used by getUsers (and other tools) to make authenticated HTTP requests to the CS-Cart API endpoints.
    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 offers minimal insight. It states it 'gets' a list, implying a read operation, but doesn't cover pagination behavior, rate limits, authentication needs, or what the return format looks like (e.g., list structure, fields). For a tool with 4 parameters and no output schema, this leaves significant gaps in understanding how it behaves.

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 four words, with no wasted language. It's front-loaded with the core action and resource, making it easy to parse quickly. Every word ('Get', 'list', 'users/customers') directly contributes to understanding the tool's function.

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?

Given the tool has 4 parameters, no annotations, and no output schema, the description is incomplete. It doesn't address behavioral aspects like pagination handling, filtering logic, or return format, which are critical for an agent to use it correctly. The high schema coverage helps with parameters, but overall context for invocation and results is lacking.

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 parameters (page, items_per_page, status, user_type) with descriptions, defaults, and enums. The description adds no additional parameter semantics beyond implying a list output, which is already clear from the tool name. This meets the baseline of 3 for high schema coverage.

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 'Get list of users/customers' clearly states the verb ('Get') and resource ('users/customers'), making the purpose immediately understandable. However, it doesn't differentiate from potential sibling tools like 'get_categories' or 'get_products' beyond the resource name, and the dual 'users/customers' phrasing is slightly ambiguous about whether these are distinct categories.

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 prerequisites, context for filtering, or comparisons to other tools like 'get_orders' that might involve user data. Usage is implied only by the name and parameters, with no explicit when/when-not instructions.

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