Skip to main content
Glama
hungryweb

CS-Cart MCP Server

by hungryweb

get_orders

Retrieve and filter orders from a CS-Cart store using pagination, status filters, time periods, and user-specific queries.

Instructions

Retrieve orders from the CS-Cart store

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoPage number for pagination
items_per_pageNoNumber of items per page
statusNoOrder status filter (O=Open, P=Processed, C=Complete, F=Failed, D=Declined, B=Backordered, I=Incomplete)
periodNoTime period filter (A=All time, D=Today, W=This week, M=This month, Y=This year)
time_fromNoStart date for custom period (YYYY-MM-DD)
time_toNoEnd date for custom period (YYYY-MM-DD)
user_idNoFilter by user ID

Implementation Reference

  • Main handler function for get_orders tool: constructs query parameters from args and performs GET request to CS-Cart /orders API endpoint using makeRequest helper.
    async getOrders(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.period) params.append('period', args.period);
      if (args.time_from) params.append('time_from', args.time_from);
      if (args.time_to) params.append('time_to', args.time_to);
      if (args.user_id) params.append('user_id', args.user_id.toString());
    
      const queryString = params.toString();
      const endpoint = `/orders${queryString ? `?${queryString}` : ''}`;
      
      const result = await this.makeRequest('GET', endpoint);
      return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
    }
  • Input schema for the get_orders tool, defining parameters for pagination, status filtering, time periods, and user 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: 'Order status filter (O=Open, P=Processed, C=Complete, F=Failed, D=Declined, B=Backordered, I=Incomplete)',
          enum: ['O', 'P', 'C', 'F', 'D', 'B', 'I'],
        },
        period: {
          type: 'string',
          description: 'Time period filter (A=All time, D=Today, W=This week, M=This month, Y=This year)',
          enum: ['A', 'D', 'W', 'M', 'Y'],
        },
        time_from: {
          type: 'string',
          description: 'Start date for custom period (YYYY-MM-DD)',
        },
        time_to: {
          type: 'string',
          description: 'End date for custom period (YYYY-MM-DD)',
        },
        user_id: {
          type: 'number',
          description: 'Filter by user ID',
        },
      },
    },
  • src/index.js:246-286 (registration)
    Registration of the get_orders tool in the ListToolsRequestHandler, specifying name, description, and input schema.
    {
      name: 'get_orders',
      description: 'Retrieve orders 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: 'Order status filter (O=Open, P=Processed, C=Complete, F=Failed, D=Declined, B=Backordered, I=Incomplete)',
            enum: ['O', 'P', 'C', 'F', 'D', 'B', 'I'],
          },
          period: {
            type: 'string',
            description: 'Time period filter (A=All time, D=Today, W=This week, M=This month, Y=This year)',
            enum: ['A', 'D', 'W', 'M', 'Y'],
          },
          time_from: {
            type: 'string',
            description: 'Start date for custom period (YYYY-MM-DD)',
          },
          time_to: {
            type: 'string',
            description: 'End date for custom period (YYYY-MM-DD)',
          },
          user_id: {
            type: 'number',
            description: 'Filter by user ID',
          },
        },
      },
    },
  • Shared helper method used by get_orders (and other tools) to make authenticated HTTP requests to the CS-Cart API.
    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;
    }
  • src/index.js:404-405 (registration)
    Dispatcher case in CallToolRequestHandler that routes get_orders calls to the getOrders handler method.
    case 'get_orders':
      return await this.getOrders(args);
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It only states the basic action ('Retrieve') without mentioning whether this is a read-only operation, if it requires authentication, what the return format looks like (e.g., list of orders with fields), pagination behavior beyond parameters, or any rate limits. This is inadequate for a tool with 7 parameters and no output schema.

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 gets straight to the point without any wasted words. It's appropriately sized for a straightforward retrieval tool and is perfectly front-loaded with 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?

Given the tool's complexity (7 parameters, no output schema, and no annotations), the description is insufficient. It doesn't explain what the tool returns (e.g., order objects with fields like ID, total, customer), how results are structured, or any behavioral aspects like error handling. For a list-retrieval tool with filtering options, more context is needed to use it 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?

The schema description coverage is 100%, with all parameters clearly documented in the input schema itself. The description adds no additional parameter information beyond what's already in the schema, so it meets the baseline of 3. However, it doesn't compensate for any gaps since there are none in the schema.

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 ('Retrieve') and resource ('orders from the CS-Cart store'), making the purpose immediately understandable. However, it doesn't distinguish this tool from its sibling 'get_order' (singular), which likely retrieves a single order by ID, leaving some ambiguity about when to use one versus the other.

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 the sibling 'get_order' for single-order retrieval or other filtering tools like 'get_sales_statistics' for aggregated data. There's no context about prerequisites, limitations, or typical use cases.

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