Skip to main content
Glama
wspotter

MCP Art Supply Store

by wspotter

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' },
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. It mentions 'calculate' and 'financial reporting', implying a read-only operation for reporting purposes, but doesn't clarify permissions needed, whether it accesses live or cached data, rate limits, or what the output format looks like. For a tool with no annotations, this leaves significant behavioral gaps.

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. Every word contributes meaning without redundancy, making it easy to parse quickly. There's no wasted text or unnecessary elaboration.

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 no annotations and no output schema, the description is moderately complete. It covers the purpose and hints at behavior but lacks details on output format, error handling, or integration with other tools. For a calculation tool with two parameters, it's adequate but leaves room for improvement in guiding an agent fully.

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?

The description adds some meaning beyond the input schema: it explains that 'valueType' determines calculation at 'cost or retail price', which aligns with the schema's description. However, with 100% schema description coverage, the schema already documents both parameters well. The description doesn't provide additional context like examples or constraints, so it meets the baseline for high schema coverage.

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: 'Calculate total inventory value at cost or retail price for financial reporting.' It specifies the verb (calculate), resource (total inventory value), and context (financial reporting). However, it doesn't explicitly differentiate from sibling tools like 'check_inventory' or 'get_low_stock_items', which might also involve inventory data.

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 mentions 'financial reporting' as context but doesn't specify prerequisites, exclusions, or compare it to similar tools like 'check_inventory' or 'calculate_profit_margin'. Without this, an agent might struggle to choose appropriately among inventory-related tools.

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