Skip to main content
Glama
hungryweb

CS-Cart MCP Server

by hungryweb

get_users

Retrieve a paginated list of users/customers from CS-Cart, filtered by status and user type (Admin, Vendor, or Customer). Manage data efficiently with page and item-per-page controls.

Instructions

Get list of users/customers

Input Schema

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

Implementation Reference

  • Core handler function that constructs query parameters from input args and makes a GET request to the CS-Cart /users API endpoint, returning the JSON response.
    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) }] }; }
  • src/index.js:327-355 (registration)
    Registers the get_users tool in the ListToolsRequest handler, providing name, description, and 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'], }, }, }, },
  • Input schema definition for the get_users tool, specifying parameters for pagination, status, and user type filtering.
    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)
    Dispatches execution of the get_users tool in the CallToolRequest handler by calling the getUsers method.
    case 'get_users': return await this.getUsers(args);
  • Shared helper method used by getUsers to make authenticated API requests to the CS-Cart backend.
    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; }

Other Tools

Related 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'

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