formlab-mcp 0.7.12 → 0.7.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "formlab-mcp",
3
- "version": "0.7.12",
3
+ "version": "0.7.13",
4
4
  "mcpName": "io.github.juliu1980/formlab-mcp",
5
5
  "description": "Read-only Model Context Protocol server for FormLab. Lets Claude and other MCP clients read and analyze your FormLab data, from a local export file or your live cloud workspace.",
6
6
  "homepage": "https://formvix.com/mcp",
package/server.json CHANGED
@@ -2,13 +2,13 @@
2
2
  "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
3
3
  "name": "io.github.juliu1980/formlab-mcp",
4
4
  "description": "Read-only MCP server for FormLab formulation data: a local export file or your live cloud workspace.",
5
- "version": "0.7.12",
5
+ "version": "0.7.13",
6
6
  "websiteUrl": "https://formvix.com/mcp",
7
7
  "packages": [
8
8
  {
9
9
  "registryType": "npm",
10
10
  "identifier": "formlab-mcp",
11
- "version": "0.7.12",
11
+ "version": "0.7.13",
12
12
  "runtimeHint": "npx",
13
13
  "transport": {
14
14
  "type": "stdio"
package/tools/lab.js CHANGED
@@ -394,7 +394,7 @@ const list_batches = {
394
394
  const get_batch = {
395
395
  definition: {
396
396
  name: 'get_batch',
397
- description: 'Get full details for a single batch including the raw lots it drew (lotsUsed: lot number, quantity, and the status of each lot now, with holdReason for a lot on hold), hold (now) and holdHistory (every hold with its release: when, by whom, and the note, e.g. "Released with lot ETH-1"), certificates (each Certificate of Analysis as issued and saved: number, when, by whom, customer, PO, verdict, override reason, the results it printed; a shipment\'s coaNumber names the one it went with), its actual composition (as-prepared, when logged), child samples, lineage (parent / sub-blend parents), and — treating the batch as a finished-goods lot — its storage `location` and finished-goods `stockLedger` (shipments out + adjustments; on-hand = produced − sample pulls − sub-batch draws + Σ ledger). Plus finished-product density + actual volume (measured directly or derived as actual mass ÷ measured density — never summed from per-ingredient volumes). Accepts internal id or UID. Also returns `theoreticalParameters` computed on the batch as made (its actual composition when logged — `basis: "actual"` — else the recipe of its formula), with the batch parameter list when it overrides the one on the formula; same fields as get_formulation. `reactiveBalance` is the same as get_formulation\'s, on what was weighed (basis "as weighed"), e.g. a soap batch\'s superfat and lye excess.',
397
+ description: 'Get full details for a single batch including the raw lots it drew (lotsUsed: lot number, quantity, and the status of each lot now, with holdReason for a lot on hold), hold (now) and holdHistory (every hold with its release: when, by whom, and the note, e.g. "Released with lot ETH-1"), certificates (each Certificate of Analysis as issued and saved: number, when, by whom, customer, PO, verdict, override reason, the results it printed; a shipment\'s coaNumber names the one it went with; a voided one has voided, voidedAt, voidedBy, voidReason, and the shipment coaVoided), its actual composition (as-prepared, when logged), child samples, lineage (parent / sub-blend parents), and — treating the batch as a finished-goods lot — its storage `location` and finished-goods `stockLedger` (shipments out + adjustments; on-hand = produced − sample pulls − sub-batch draws + Σ ledger). Plus finished-product density + actual volume (measured directly or derived as actual mass ÷ measured density — never summed from per-ingredient volumes). Accepts internal id or UID. Also returns `theoreticalParameters` computed on the batch as made (its actual composition when logged — `basis: "actual"` — else the recipe of its formula), with the batch parameter list when it overrides the one on the formula; same fields as get_formulation. `reactiveBalance` is the same as get_formulation\'s, on what was weighed (basis "as weighed"), e.g. a soap batch\'s superfat and lye excess.',
398
398
  inputSchema: {
399
399
  type: 'object',
400
400
  properties: {
@@ -444,7 +444,7 @@ const get_batch = {
444
444
  ...(Array.isArray(e.qcOpen) && e.qcOpen.length ? { shippedWithQcOpen: e.qcOpen, qcReason: e.qcReason || null } : {}),
445
445
  // 2 Dec: the CoA it went with (null = none issued), and no ingredient lots recorded. Older shipments carry neither.
446
446
  // 0.7.12: the saved certificate it went with (its number in certificates).
447
- ...(e.kind === 'shipment' && e.coaId ? { coaNumber: ((Array.isArray(b.coas) ? b.coas : []).find(c => c && c.id === e.coaId) || {}).n ?? null } : {}),
447
+ ...(e.kind === 'shipment' && e.coaId ? (() => { const c = (Array.isArray(b.coas) ? b.coas : []).find(x => x && x.id === e.coaId) || {}; return { coaNumber: c.n ?? null, ...(c.voidedAt ? { coaVoided: true } : {}) }; })() : {}),
448
448
  ...(e.kind === 'shipment' && 'coaAt' in e ? { coaIssuedAt: e.coaAt || null, ...(e.coaCustomer ? { coaCustomer: e.coaCustomer } : {}), ...(e.coaPo ? { coaPo: e.coaPo } : {}), noLotsRecorded: !!e.noLots } : {}),
449
449
  })),
450
450
  shippedQty: (Array.isArray(b.stockLedger) ? b.stockLedger : []).reduce((s, e) => e.kind === 'shipment' ? s + Math.abs(parseFloat(e.delta) || 0) : s, 0),
@@ -456,7 +456,9 @@ const get_batch = {
456
456
  certificates: (Array.isArray(b.coas) ? b.coas : []).filter(c => c && c.id).map(c => ({
457
457
  number: c.n ?? null, issuedAt: c.issuedAt || null, issuedBy: c.issuedBy || '', product: c.product || '', customer: c.customer || '', po: c.po || '',
458
458
  resultsUpTo: c.upTo || null, verdict: c.conforms === false ? 'does not conform' : c.untested ? 'not tested (override)' : c.conforms === true ? 'conforms' : 'reported',
459
- ...(c.override ? { overrideReason: c.override } : {}), ...(Array.isArray(c.notTested) && c.notTested.length ? { notTested: c.notTested } : {}),
459
+ ...(c.override ? { overrideReason: c.override } : {}),
460
+ // 0.7.13: a voided certificate stays, marked (never deleted).
461
+ ...(c.voidedAt ? { voided: true, voidedAt: c.voidedAt, voidedBy: c.voidedBy || '', voidReason: c.voidReason || '' } : {}), ...(Array.isArray(c.notTested) && c.notTested.length ? { notTested: c.notTested } : {}),
460
462
  results: (c.rows || []).map(r => ({ parameter: r.name, ...(r.cond ? { conditions: r.cond } : {}), value: r.value, unit: r.unit || '', spec: r.spec || null, status: r.status || 'reported', testReport: r.testUid || null, testDate: r.testDate || null, ...(r.doubt ? { inDoubt: r.doubt } : {}) })),
461
463
  sourceReports: c.sources || [],
462
464
  })),