Skip to main content
Glama

get_inventory_value

Calculate total inventory value at cost or retail price for financial reporting. Filter by category to analyze specific product groups.

Instructions

Calculate total inventory value at cost or retail price for financial reporting.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryNoOptional: filter by category
valueTypeYesCalculate at: cost or retail price

Implementation Reference

  • Executes the get_inventory_value tool by filtering inventory optionally by category, computing retail value (sum of price * quantity), estimating cost value (60% of retail assuming 40% markup), and returning a formatted text response with totals and potential profit.
    case 'get_inventory_value': { const valueType = String(args?.valueType || 'retail'); const category = args?.category ? String(args.category) : null; let items = storeData.inventory; if (category) { items = items.filter(i => i.category.toLowerCase() === category.toLowerCase()); } const retailValue = items.reduce((sum, item) => sum + (item.price * item.quantity), 0); const costValue = retailValue * 0.6; // Assume 40% markup return { content: [{ type: 'text', text: `💎 Inventory Valuation${category ? ` - ${category}` : ''}\n\n📦 Total Items: ${items.length}\n📊 Total Units: ${items.reduce((sum, i) => sum + i.quantity, 0)}\n\n💰 Value at Cost: $${costValue.toFixed(2)}\n💵 Value at Retail: $${retailValue.toFixed(2)}\n📈 Potential Profit: $${(retailValue - costValue).toFixed(2)}` }] }; }
  • Input schema definition for the get_inventory_value tool, specifying valueType as required (cost or retail) and optional category filter.
    { name: 'get_inventory_value', description: 'Calculate total inventory value at cost or retail price for financial reporting.', inputSchema: { type: 'object', properties: { valueType: { type: 'string', description: 'Calculate at: cost or retail price' }, category: { type: 'string', description: 'Optional: filter by category' }, }, required: ['valueType'], }, },
  • src/index.ts:516-518 (registration)
    Registration of all tools including get_inventory_value via the ListToolsRequestHandler returning the tools array.
    server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });
  • src/dashboard.ts:69-69 (registration)
    Mock tool listing in the dashboard server for UI display.
    { name: 'get_inventory_value', description: 'Inventory valuation', category: 'Reporting' },

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