# What's our inventory worth by warehouse?

> A real Claude session on a Fishbowl database (ILC's demo company, sample data), connected through ILC MCP for Fishbowl. The answer below is what the AI said; the queries are what it ran. Page: https://israellopezconsulting.com/fishbowl-mcp/questions/inventory-value

## Question

What's our inventory worth by warehouse?

### Answer

Total inventory on hand is worth **$53,860.77** at average cost, across four warehouses in the DEMO Fishbowl database:

| Warehouse | Parts stocked | Qty on hand | Value | Share |
|---|---|---|---|---|
| LA | 50 | 82,238.06 | $22,420.13 | 41.6% |
| MI | 50 | 57,294.25 | $18,292.63 | 34.0% |
| Main | 30 | 25,889.44 | $10,507.63 | 19.5% |
| SLC | 6 | 3,461.00 | $2,640.38 | 4.9% |
| **Total** | | | **$53,860.77** | |

- **Method:** each warehouse's on-hand quantity is multiplied by the part's company-wide average cost; the company's costing method is Average Costing. Every stocked part has a cost.
- **Cross-check:** the four warehouses sum exactly to Fishbowl's own company-wide part cost total.
- **Discrepancy:** open cost layers total $59,120.36, about $5,260 more than the average-cost figure. I haven't traced which parts account for the gap.
- **Scope:** on-hand includes everything physically in each warehouse, including stock in receiving or other locations not counted as available. Quantities mix units of measure, so that column is only a rough size indicator.

## Behind the scenes

Every step the AI took, as recorded in the query log. All queries are read-only and row-capped.

1. Checked the saved queries — 6 saved queries
2. Read the Fishbowl notes index — 13 topic notes
3. Read Fishbowl notes (INVENTORY.md)
4. Read Fishbowl notes (ACCOUNTING.md)
5. Ran a read-only query: Total inventory value broken down by warehouse (location group), at average cost — 4 rows, 256 ms

   ```sql
   SELECT lg.name AS locationGroup, COUNT(DISTINCT q.PARTID) AS parts, ROUND(SUM(q.QTY), 2) AS qtyOnHand, ROUND(SUM(q.QTY * pc.avgCost), 2) AS valueAtAvgCost, SUM(CASE WHEN pc.partId IS NULL OR pc.avgCost = 0 THEN 1 ELSE 0 END) AS partsWithNoCost
   FROM qtyonhand AS q
   JOIN locationgroup AS lg ON lg.id = q.LOCATIONGROUPID
   LEFT JOIN partcost AS pc ON pc.partId = q.PARTID
   WHERE q.QTY <> @zero
   GROUP BY lg.name
   ORDER BY valueAtAvgCost DESC
   LIMIT 101
   ```

6. Ran a read-only query: Confirm the costing method and company-wide inventory value to cross-check the by-warehouse totals — ? rows, ? ms

   ```sql
   
   ```

7. Ran a read-only query: Confirm the costing method and company-wide inventory value to cross-check the by-warehouse totals — 1 row, 190 ms

   ```sql
   SELECT (SELECT sysValue
   FROM sysproperties
   WHERE sysKey = @k) AS costingMethod, (SELECT ROUND(SUM(totalCost), 2)
   FROM partcost) AS partcostTotal, (SELECT ROUND(SUM(totalCost), 2)
   FROM costlayer
   WHERE statusId = @open) AS openLayerTotal
   LIMIT 101
   ```

Learn more: https://israellopezconsulting.com/fishbowl-mcp · More examples: https://israellopezconsulting.com/fishbowl-mcp/questions
