Skip to main content
Glama
wspotter

MCP Art Supply Store

by wspotter

forecast_demand

Predict product demand using historical sales data and seasonal patterns to optimize inventory planning for art supplies.

Instructions

Forecast product demand based on historical sales data and seasonal trends.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
periodYesForecast period: week, month, quarter
skuYesProduct SKU

Implementation Reference

  • The handler function for the 'forecast_demand' tool. It takes SKU and period as input, finds the product in mock inventory, computes a simple forecast using a baseline sales rate adjusted by period multiplier, compares to current stock, and returns a formatted text response with forecast details and stock warning if necessary.
    case 'forecast_demand': {
      const sku = String(args?.sku || '');
      const period = String(args?.period || 'month');
      const item = storeData.inventory.find(i => i.id === sku);
      
      if (!item) {
        return { content: [{ type: 'text', text: `āŒ Product ${sku} not found` }] };
      }
      
      const baselineSales = 50;
      const periodMultiplier = period === 'week' ? 0.25 : period === 'month' ? 1 : 3;
      const forecast = Math.round(baselineSales * periodMultiplier);
      
      return {
        content: [{
          type: 'text',
          text: `šŸ“ˆ Demand Forecast: ${item.name}\n\nšŸ“… Period: Next ${period}\nšŸ“Š Forecasted Sales: ~${forecast} units\nšŸ“¦ Current Stock: ${item.quantity} units\n\n${item.quantity < forecast ? `āš ļø WARNING: Current stock may not meet demand!\nšŸ’” Recommended order: ${forecast - item.quantity + item.reorderLevel} units` : 'āœ… Current stock sufficient for forecasted demand'}`
        }]
      };
    }
  • The tool schema definition including name, description, and inputSchema specifying required 'sku' and 'period' parameters.
      name: 'forecast_demand',
      description: 'Forecast product demand based on historical sales data and seasonal trends.',
      inputSchema: {
        type: 'object',
        properties: {
          sku: { type: 'string', description: 'Product SKU' },
          period: { type: 'string', description: 'Forecast period: week, month, quarter' },
        },
        required: ['sku', 'period'],
      },
    },
  • src/index.ts:516-518 (registration)
    Registers all tools (including 'forecast_demand') via the ListToolsRequestHandler which returns the full tools array containing the forecast_demand schema.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return { tools };
    });
  • src/dashboard.ts:70-70 (registration)
    Mock tool registration in dashboard toolsData for UI display and test endpoint simulation.
    { name: 'forecast_demand', description: 'Demand forecasting', category: 'Reporting' },
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions the tool forecasts based on historical data and seasonal trends, which gives some context, but lacks details on permissions, rate limits, output format, or whether it's a read-only operation. For a tool with no annotations, this is a significant gap in transparency.

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 details. Every word contributes to understanding the tool's function, making it appropriately sized and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (forecasting with 2 parameters), no annotations, and no output schema, the description is minimally adequate. It covers the basic purpose but lacks behavioral context, usage guidelines, and output details, leaving gaps that could hinder an AI agent's effective use.

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 already documents both parameters ('period' and 'sku') with descriptions. The description adds no additional parameter semantics beyond what's in the schema, such as explaining how 'period' affects the forecast or what 'sku' entails. Baseline 3 is appropriate when the schema handles parameter documentation.

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 tool's purpose as 'Forecast product demand based on historical sales data and seasonal trends,' which includes a specific verb ('forecast'), resource ('product demand'), and methodology. However, it doesn't explicitly differentiate from sibling tools like 'get_daily_sales' or 'get_sales_report,' which might also involve sales data analysis, though the forecasting focus is distinct.

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 prerequisites (e.g., needing historical data), exclusions (e.g., not for real-time updates), or compare to siblings like 'get_sales_report' for past data versus this for future predictions, leaving usage context implied at best.

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/wspotter/mcpart'

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