Skip to main content
Glama
wspotter

MCP Art Supply Store

by wspotter

get_daily_sales

Retrieve daily sales data including revenue, transaction count, and top-selling items for business analysis and reporting.

Instructions

Get sales summary for a specific date including revenue, transaction count, and top-selling items.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateNoDate in YYYY-MM-DD format (default: today)

Implementation Reference

  • The core handler logic for the 'get_daily_sales' MCP tool. It fetches sales data for a given date from the mock storeData.sales array and formats a response with revenue, transaction count, average transaction value, and top-selling item.
    case 'get_daily_sales': {
      const date = String(args?.date || '2025-10-03');
      const salesData = storeData.sales.find(s => s.date === date);
      
      if (!salesData) {
        return { content: [{ type: 'text', text: `No sales data found for ${date}` }] };
      }
      
      return {
        content: [{
          type: 'text',
          text: `πŸ“Š Sales Report for ${salesData.date}\n\nπŸ’΅ Revenue: $${salesData.revenue.toFixed(2)}\nπŸ›’ Transactions: ${salesData.transactions}\nπŸ“ˆ Avg Transaction: $${(salesData.revenue / salesData.transactions).toFixed(2)}\nπŸ† Top Seller: ${salesData.topItem}`
        }]
      };
    }
  • The tool schema definition including name, description, and input schema (optional date parameter). This is returned by the ListToolsRequestHandler.
      name: 'get_daily_sales',
      description: 'Get sales summary for a specific date including revenue, transaction count, and top-selling items.',
      inputSchema: {
        type: 'object',
        properties: {
          date: { type: 'string', description: 'Date in YYYY-MM-DD format (default: today)' },
        },
      },
    },
  • src/index.ts:516-518 (registration)
    Registration of the tools list via ListToolsRequestHandler, which includes 'get_daily_sales' in the 'tools' array.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return { tools };
    });
  • src/index.ts:518-521 (registration)
    The CallToolRequestHandler switch statement registers and dispatches to the get_daily_sales case handler.
    });
    
    // Handle tool calls
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
  • Mock sales data used by the get_daily_sales handler.
    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' },
    ],

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