Skip to main content
Glama
wspotter

MCP Art Supply Store

by wspotter

get_sales_report

Generate comprehensive sales reports for specific date ranges to analyze trends, compare performance, and gain business insights for art supply store management.

Instructions

Generate comprehensive sales report for a date range with trends, comparisons, and insights.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endDateYesEnd date in YYYY-MM-DD format
startDateYesStart date in YYYY-MM-DD format

Implementation Reference

  • Tool schema definition with input schema requiring startDate and endDate parameters.
      name: 'get_sales_report',
      description: 'Generate comprehensive sales report for a date range with trends, comparisons, and insights.',
      inputSchema: {
        type: 'object',
        properties: {
          startDate: { type: 'string', description: 'Start date in YYYY-MM-DD format' },
          endDate: { type: 'string', description: 'End date in YYYY-MM-DD format' },
        },
        required: ['startDate', 'endDate'],
      },
    },
  • Handler function that filters sales data by date range, computes totals, averages, and returns a formatted sales report.
    case 'get_sales_report': {
      const startDate = String(args?.startDate || '');
      const endDate = String(args?.endDate || '');
      
      const periodSales = storeData.sales.filter(s => s.date >= startDate && s.date <= endDate);
      const totalRevenue = periodSales.reduce((sum, s) => sum + s.revenue, 0);
      const totalTransactions = periodSales.reduce((sum, s) => sum + s.transactions, 0);
      
      return {
        content: [{
          type: 'text',
          text: `πŸ“Š Sales Report: ${startDate} to ${endDate}\n\nπŸ’° Total Revenue: $${totalRevenue.toFixed(2)}\nπŸ›’ Total Transactions: ${totalTransactions}\nπŸ“ˆ Average Transaction: $${(totalRevenue / totalTransactions).toFixed(2)}\nπŸ“… Days in Period: ${periodSales.length}\nπŸ“Š Daily Average: $${(totalRevenue / periodSales.length).toFixed(2)}`
        }]
      };
    }
  • Mock sales data array used by the get_sales_report handler to compute reports.
    sales: [
      { date: '2025-10-03', revenue: 456.78, transactions: 12, topItem: 'Acrylic Paint Set' },
      { date: '2025-10-02', revenue: 623.45, transactions: 18, topItem: 'Canvas Panel 16x20"' },
      { date: '2025-10-01', revenue: 389.90, transactions: 9, topItem: 'Oil Paint Starter Kit' },
      { date: '2025-09-30', revenue: 712.34, transactions: 21, topItem: 'Drawing Pencil Set' },
    ],
  • src/index.ts:516-518 (registration)
    Registration of all tools list handler, which includes get_sales_report in the tools array.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return { 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/wspotter/mcpart'

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