# What does one batch of each cookie cost us to make?

> 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/cost-per-batch

## Question

What does one batch of each cookie cost us to make?

### Answer

Ingredient cost per batch, using each recipe's bill of materials in Fishbowl priced at current average cost:

| Cookie | Batch size | Cost per batch | Cost per cookie |
|---|---|---|---|
| Oatmeal Chocolate Chip (BB2003) | 200 | $72.64 | $0.363 |
| Chocolate Chip (BB2005) | 24 | $15.18 | $0.633 |
| Chocolate Fudge (BB2002) | 25 | $7.64 | $0.306 |
| Snickerdoodle (BB2004) | 48 | $7.15 | $0.149 |
| Sugar Cookie (FG2200) | 48 | $2.23 | $0.046 |

These are materials only; none of the recipes carry labor or overhead lines.

- **Butter drives the cost.** It's averaging $0.76/oz (about $12.23/lb), which makes it $30.57 of the Oatmeal batch and $6.11 of the Chocolate Chip batch. Chocolate chips at $4.62/lb are the next biggest line.
- **Snickerdoodle uses the default options.** That's Shortening Brand Y and Cream of Tartar Brand Z; switching to the cheapest tartar (Brand Y) brings the batch to about $7.08.
- **Chocolate Chip doesn't match its inventory value.** Finished Chocolate Chip cookies are carried at $0.365 each, well under the $0.633 the recipe rolls up to today. Oatmeal runs the same direction ($0.271 carried vs. $0.363); the other three are within a few cents.
- **Custom Cookie BOM (24) is configurable**, so its cost depends on the options picked. With defaults it's about $7.05, though $2.80 of that is an 8 oz baking powder line that looks like a typo (the Sugar Cookie batch uses 0.08 oz).

## 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. Ran a read-only query: List bills of materials to find the cookie recipes and compute cost per batch — 14 rows, 252 ms

   ```sql
   SELECT b.id, b.num, b.description, b.activeFlag
   FROM bom AS b
   ORDER BY b.num
   LIMIT 501
   ```

4. Ran a read-only query: Get every line of the cookie bills of materials with quantity, unit conversion and part cost to compute cost per batch — 89 rows, 204 ms

   ```sql
   SELECT b.id AS bomId, b.num AS bom, bi.id AS itemId, bi.typeId, bit.name AS itemType, p.num AS part, p.description, bi.quantity, lu.code AS bomUom, pu.code AS stockUom, CASE WHEN bi.uomId = p.uomId THEN 1 ELSE uc.multiply / uc.factor END AS convToStock, (uc.id IS NULL AND bi.uomId <> p.uomId) AS missingConv, p.stdCost, pc.avgCost, pc.qty AS costQty, bi.oneTimeItem + 0 AS oneTime, bi.variableQty + 0 AS variableQty, bi.stage + 0 AS stage, sb.num AS stageBom, bg.name AS optionGroup, bi.groupDefault + 0 AS groupDefault, pt.name AS partType
   FROM bom AS b
   JOIN bomitem AS bi ON bi.bomId = b.id
   JOIN bomitemtype AS bit ON bit.id = bi.typeId
   LEFT JOIN part AS p ON p.id = bi.partId
   LEFT JOIN parttype AS pt ON pt.id = p.typeId
   LEFT JOIN uom AS pu ON pu.id = p.uomId
   LEFT JOIN uom AS lu ON lu.id = bi.uomId
   LEFT JOIN uomconversion AS uc ON uc.fromUomId = bi.uomId AND uc.toUomId = p.uomId
   LEFT JOIN partcost AS pc ON pc.partId = p.id
   LEFT JOIN bom AS sb ON sb.id = bi.stageBomId
   LEFT JOIN bomitemgroup AS bg ON bg.id = bi.bomItemGroupId
   WHERE b.id IN (4, 2, 5, 6, 14, 18, 13, 17, 16, 15)
   ORDER BY b.num, bi.typeId, bi.sortIdConfig, bi.id
   LIMIT 501
   ```

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