Skip to main content
Glama
hungryweb

CS-Cart MCP Server

by hungryweb

get_sales_statistics

Retrieve sales data for a specified time frame (daily, weekly, monthly, yearly) or custom period to analyze performance on CS-Cart MCP Server.

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 executes the get_sales_statistics tool by constructing query parameters and making a GET request to 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) }] }; }
  • Tool definition including name, description, and input schema for validation in the ListTools response.
    { 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)
    Registration in the CallToolRequest handler switch statement that routes to the getSalesStatistics method.
    case 'get_sales_statistics': return await this.getSalesStatistics(args);

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