check_inventory
Check current stock levels, reorder status, and supplier details for specific art supply products or categories to manage inventory effectively.
Instructions
Check current inventory levels for a specific product or category. Returns stock quantity, reorder status, and supplier information.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| search | Yes | Product name, SKU, or category to search for |
Implementation Reference
- src/index.ts:573-590 (handler)The handler function for the 'check_inventory' tool. It filters the mock inventory data based on the search parameter (product name, SKU, or category) and returns detailed stock information including low stock warnings.case 'check_inventory': { const search = String(args?.search || '').toLowerCase(); const results = storeData.inventory.filter(item => item.name.toLowerCase().includes(search) || item.id.toLowerCase().includes(search) || item.category.toLowerCase().includes(search) ); return { content: [{ type: 'text', text: results.length > 0 ? `Found ${results.length} item(s):\n\n${results.map(item => `${item.name} (${item.id})\n- Category: ${item.category}\n- Stock: ${item.quantity} units${item.quantity <= item.reorderLevel ? ' ⚠️ LOW STOCK' : ''}\n- Price: $${item.price}\n- Supplier: ${item.supplier}\n- Last Restocked: ${item.lastRestocked}` ).join('\n\n')}` : `No items found matching "${args?.search}"` }] }; }
- src/index.ts:68-78 (schema)The input schema definition for the 'check_inventory' tool, specifying a required 'search' string parameter.{ name: 'check_inventory', description: 'Check current inventory levels for a specific product or category. Returns stock quantity, reorder status, and supplier information.', inputSchema: { type: 'object', properties: { search: { type: 'string', description: 'Product name, SKU, or category to search for' }, }, required: ['search'], }, },
- src/index.ts:516-518 (registration)Registration of all tools including 'check_inventory' via the ListToolsRequestSchema handler that returns the tools array containing the tool definition.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });