Skip to main content
Glama
hungryweb

CS-Cart MCP Server

by hungryweb

get_sales_statistics

Retrieve sales data for specified time periods to analyze performance in CS-Cart stores, supporting daily, weekly, monthly, yearly, or custom date ranges.

Instructions

Get sales statistics for a specific period

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
periodNoTime period (D=Today, W=This week, M=This month, Y=This year)M
time_fromNoStart date for custom period (YYYY-MM-DD)
time_toNoEnd date for custom period (YYYY-MM-DD)

Implementation Reference

  • The handler function that implements the core logic of the get_sales_statistics tool. It constructs URL query parameters based on input arguments and fetches sales statistics from the /statistics/sales API endpoint.
    async getSalesStatistics(args) {
      const params = new URLSearchParams();
      
      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);
    
      const queryString = params.toString();
      const endpoint = `/statistics/sales${queryString ? `?${queryString}` : ''}`;
      
      const result = await this.makeRequest('GET', endpoint);
      return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
    }
  • Input schema defining the parameters for the get_sales_statistics tool: period (enum with defaults), and optional custom date ranges.
    inputSchema: {
      type: 'object',
      properties: {
        period: {
          type: 'string',
          description: 'Time period (D=Today, W=This week, M=This month, Y=This year)',
          enum: ['D', 'W', 'M', 'Y'],
          default: 'M',
        },
        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)',
        },
      },
    },
  • src/index.js:358-380 (registration)
    Tool registration in the listTools method, specifying name, description, and input schema.
    {
      name: 'get_sales_statistics',
      description: 'Get sales statistics for a specific period',
      inputSchema: {
        type: 'object',
        properties: {
          period: {
            type: 'string',
            description: 'Time period (D=Today, W=This week, M=This month, Y=This year)',
            enum: ['D', 'W', 'M', 'Y'],
            default: 'M',
          },
          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)',
          },
        },
      },
    },
  • src/index.js:412-413 (registration)
    Dispatch case in the request handler switch statement that routes calls to the getSalesStatistics method.
    case 'get_sales_statistics':
      return await this.getSalesStatistics(args);
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 what the tool does without behavioral details. It doesn't disclose if this is a read-only operation, requires authentication, has rate limits, or what the output format might be, which is inadequate for a tool with potential data retrieval implications.

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 front-loads the core purpose without unnecessary words. Every part earns its place by clearly stating the action and scope, making it easy to parse quickly.

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 no annotations and no output schema, the description is incomplete for a data retrieval tool. It lacks details on return values, error handling, or behavioral traits, which are crucial for an agent to use it effectively in context with sibling tools.

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 three parameters with descriptions, enum values, and defaults. The description adds no additional parameter semantics beyond implying period-based filtering, meeting the baseline 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 clearly states the verb 'Get' and resource 'sales statistics' with scope 'for a specific period', making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like get_orders or get_products that also retrieve data, missing explicit distinction.

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?

No guidance is provided on when to use this tool versus alternatives like get_orders or get_products for sales-related data. The description implies usage for sales statistics but doesn't specify context, prerequisites, or exclusions, leaving the agent to infer based on tool name alone.

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