formlab-mcp 0.7.2 → 0.7.3

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.2",
3
+ "version": "0.7.3",
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.2",
5
+ "version": "0.7.3",
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.2",
11
+ "version": "0.7.3",
12
12
  "runtimeHint": "npx",
13
13
  "transport": {
14
14
  "type": "stdio"
@@ -200,7 +200,7 @@ const get_formulation = {
200
200
  const get_fragrance_compliance = {
201
201
  definition: {
202
202
  name: 'get_fragrance_compliance',
203
- description: 'A formulation\'s fragrance compliance as FormLab\'s Fragrance tab computes it (Pro; live workspace only): each fragrance material\'s % in the finished product against its IFRA limit for the product category (through sub-formulas), the highest dosage that passes and the material that limits it, and the EU fragrance allergens summed across materials with the ones to name on the label (above 0.001% leave-on, 0.01% rinse-off). Every limit is one the lab typed from a supplier\'s IFRA certificate; FormLab holds no IFRA limits of its own, so a material with no limit or declaration on file is reported as unknown and state is then "incomplete", never "conforms". Optional what-if inputs (not saved): category (IFRA product category, e.g. "5A" body lotion, "4" fine fragrance), use ("leave-on" | "rinse-off"), dosage (percent of a fragrance oil in the finished product). The result is based on the certificates on file and is not a certification: say so when you report it.',
203
+ description: 'A formulation\'s fragrance compliance as FormLab\'s Fragrance tab computes it (Pro; live workspace only): each fragrance material\'s % in the finished product against its IFRA limit for the product category (through sub-formulas), the highest dosage that passes and the material that limits it, and the EU fragrance allergens summed across materials with the ones to name on the label (above 0.001% leave-on, 0.01% rinse-off; category 12, candles and air care with no skin contact, needs no product use: allergens.applies is false there). Every limit is one the lab typed from a supplier\'s IFRA certificate; FormLab holds no IFRA limits of its own, so a material with no limit or declaration on file is reported as unknown and state is then "incomplete", never "conforms". Optional what-if inputs (not saved): category (IFRA product category, e.g. "5A" body lotion, "4" fine fragrance), use ("leave-on" | "rinse-off"), dosage (percent of a fragrance oil in the finished product). The result is based on the certificates on file and is not a certification: say so when you report it.',
204
204
  inputSchema: {
205
205
  type: 'object',
206
206
  properties: {
@@ -33,6 +33,8 @@ const FL_FR_USES = { 'leave-on': 'Leave-on', 'rinse-off': 'Rinse-off' };
33
33
  // Label when the allergen in the finished product is ABOVE this (% w/w): Annex III, column h.
34
34
  const FL_FR_LABEL_OVER = { 'leave-on': 0.001, 'rinse-off': 0.01 };
35
35
  // A stored or passed value is a use only when it is one of the two keys themselves: FL_FR_USES['constructor'] is truthy.
36
+ // Category 12 (candles, air care) has no skin contact: the cosmetic leave-on / rinse-off labelling does not apply.
37
+ const _frgUseApplies = (cat) => String(cat || '').toUpperCase() !== '12';
36
38
  const _frgIsUse = (v) => typeof v === 'string' && Object.prototype.hasOwnProperty.call(FL_FR_USES, v);
37
39
 
38
40
  // The individually labelled fragrance allergens: Annex III of Regulation (EC) No 1223/2009 as amended by Regulation
@@ -279,7 +281,7 @@ function flFrCompute(f, opts) {
279
281
  st.use = _frgIsUse(st.use) ? st.use : '';
280
282
  st.dosage = _frgNum(st.dosage) > 0 && _frgNum(st.dosage) <= FL_FR_DOSAGE_MAX ? _frgNum(st.dosage) : 100;
281
283
  const out = { has: false, category: st.category, use: st.use, dosage: st.dosage, rootOil: false, rows: [], others: [], noLimit: [], noDecl: [],
282
- noSource: [], unresolved: 0, max: [], allergens: [], unlisted: [], toLabel: [], over: [], verdict: 'setup', why: [] };
284
+ noSource: [], unresolved: 0, max: [], allergens: [], unlisted: [], toLabel: [], over: [], verdict: 'setup', why: [], useApplies: _frgUseApplies(st.category) };
283
285
  if (!f) return out;
284
286
  const wk = _frgWalk(f), k = st.dosage / 100;
285
287
  out.rootOil = wk.rootOil; out.unresolved = wk.unresolved.length;
@@ -372,14 +374,14 @@ function flFrCompute(f, opts) {
372
374
 
373
375
  const n = (a, one, many) => a.length + ' ' + (a.length === 1 ? one : many);
374
376
  if (!st.category) out.why.push('Choose the product category.');
375
- if (!st.use) out.why.push('Choose leave-on or rinse-off.');
377
+ if (!st.use && out.useApplies) out.why.push('Choose leave-on or rinse-off.');
376
378
  if (out.over.length) out.why.push(n(out.over, 'material is', 'materials are') + ' over the limit.');
377
379
  if (out.noLimit.length) out.why.push(n(out.noLimit, 'material has', 'materials have') + ' no limit on file for category ' + st.category + '.');
378
380
  if (out.noDecl.length) out.why.push(n(out.noDecl, 'material has', 'materials have') + ' no allergen declaration.');
379
381
  if (out.noSource.length) out.why.push(n(out.noSource, 'entry has', 'entries have') + ' no source document.');
380
382
  if (out.unresolved) out.why.push('Part of the composition could not be weighed.');
381
383
  out.verdict = !st.category ? 'setup' : out.over.length ? 'over'
382
- : (!st.use || out.noLimit.length || out.noDecl.length || out.noSource.length || out.unresolved) ? 'unknown' : 'conforms';
384
+ : ((!st.use && out.useApplies) || out.noLimit.length || out.noDecl.length || out.noSource.length || out.unresolved) ? 'unknown' : 'conforms';
383
385
  return out;
384
386
  }
385
387
  // A food, drink or supplement: IFRA and the cosmetic allergen list do not apply to it.
@@ -477,7 +479,7 @@ function flFrSummary(f, opts) {
477
479
  reasons: c.why.slice(),
478
480
  unknown: { noLimit: c.noLimit.slice(), noDeclaration: c.noDecl.slice(), noSourceDocument: c.noSource.map(x => `${x.name} (${x.what})`), notChecked: c.others.slice() },
479
481
  allergens: {
480
- use: c.use, threshold: thr, complete: !c.noDecl.length && !!c.use,
482
+ use: c.use, applies: c.useApplies !== false, threshold: thr, complete: !c.noDecl.length && (!!c.use || c.useApplies === false),
481
483
  toLabel: c.toLabel.slice(),
482
484
  rows: c.allergens.map(a => ({ name: a.name, cas: a.cas, pctInProduct: +a.pct.toPrecision(6), label: a.label, from: a.sources.map(x => x.name) })),
483
485
  notOnEuList: c.unlisted.map(a => ({ name: a.name, cas: a.cas, pctInProduct: +a.pct.toPrecision(6) })),
@@ -502,7 +504,8 @@ function _frgStatementBlocks(f, table) {
502
504
  s.materials.map(m => ({ name: m.name, pct: p(m.pctInProduct), limit: m.limit, status: m.status, amendment: m.amendment || '—', document: m.document || 'None on file' })))}
503
505
  ${s.unknown.notChecked.length ? `<p class="muted">Not fragrance materials, not checked: ${e(s.unknown.notChecked.join(', '))}.</p>` : ''}`;
504
506
  const a = s.allergens;
505
- const lead = !a.use ? 'Leave-on or rinse-off is not set on the formula, so the label column cannot be decided.'
507
+ const lead = !a.use && !a.applies ? 'Cosmetic allergen labelling (leave-on or rinse-off) does not apply to category 12, no skin contact.'
508
+ : !a.use ? 'Leave-on or rinse-off is not set on the formula, so the label column cannot be decided.'
506
509
  : a.toLabel.length ? `To name on the label (above ${a.threshold}% in a ${a.use} product): ${a.toLabel.join(', ')}.` : `None above ${a.threshold}% in a ${a.use} product.`;
507
510
  const rows = a.rows.map(r => ({ name: r.name, cas: r.cas || '—', pct: p(r.pctInProduct), label: r.label == null ? '—' : r.label ? 'Label' : 'Below', from: r.from.join(', ') }))
508
511
  .concat(a.notOnEuList.map(r => ({ name: r.name, cas: r.cas || '—', pct: p(r.pctInProduct), label: 'Not on the EU list', from: '' })));
@@ -541,7 +544,7 @@ function flFrAiLine(f) {
541
544
  const mats = s.materials.slice(0, 12).map(m => `${m.name} ${_frgPct(m.pctInProduct)}% vs ${m.limit}${m.status === 'Pass' || m.status === 'Not restricted' ? '' : ' [' + m.status + ']'}`).join(', ');
542
545
  const al = s.allergens;
543
546
  return `${s.statement} ${max ? 'Max dosage: ' + max + '. ' : ''}Materials (% in product vs limit): ${mats}${s.materials.length > 12 ? ` (+${s.materials.length - 12} more)` : ''}.`
544
- + (al.use ? ` Allergens to label (${al.use}, above ${al.threshold}%): ${al.toLabel.length ? al.toLabel.join(', ') : 'none'}${al.missing.length ? ` [incomplete: ${al.missing.length} without a declaration]` : ''}.` : ' Allergen labelling undecided: leave-on or rinse-off not set.')
547
+ + (al.use ? ` Allergens to label (${al.use}, above ${al.threshold}%): ${al.toLabel.length ? al.toLabel.join(', ') : 'none'}${al.missing.length ? ` [incomplete: ${al.missing.length} without a declaration]` : ''}.` : al.applies ? ' Allergen labelling undecided: leave-on or rinse-off not set.' : ' Cosmetic allergen labelling does not apply (category 12, no skin contact).')
545
548
  + ` ${s.basis}`;
546
549
  } catch (_) { return ''; }
547
550
  }
@@ -714,7 +717,7 @@ function _frgControlsHtml(f, c) {
714
717
  return `<div class="card"><div class="card-header"><h2>Product</h2><span id="fr-saved" class="fl-saved-tick" role="status"></span></div>
715
718
  <div class="card-body nl-form fr-form-side">
716
719
  <label>IFRA category<select id="fr-cat-in" onchange="flFrSet('${id}','category',this.value)"><option value="">Choose…</option>${FL_FR_CATEGORIES.map(k => `<option value="${k}"${c.category === k ? ' selected' : ''}>${_frgEsc(_frgCatText(k))}</option>`).join('')}</select></label>
717
- <label>Product use<span class="nl-unit"><span class="fl-seg-group sm" role="group" aria-label="Product use">${seg('leave-on')}${seg('rinse-off')}</span></span></label>
720
+ ${c.useApplies || c.use ? `<label>Product use<span class="nl-unit"><span class="fl-seg-group sm" role="group" aria-label="Product use">${seg('leave-on')}${seg('rinse-off')}</span></span></label>` : ''}
718
721
  ${c.rootOil ? `<label data-tip="How much of this oil goes into the finished product. 100 checks it as sold.">Dosage in the product<span class="nl-unit"><input id="fr-dose-in" type="number" min="0" max="100" step="any" inputmode="decimal" value="${st.dosage !== 100 ? _frgEsc(String(st.dosage)) : ''}" placeholder="100" onchange="flFrSet('${id}','dosage',this.value)"><em>%</em></span></label>` : ''}
719
722
  ${c.others.length ? `<div class="fr-dim" data-tip="${_frgEsc(c.others.slice(0, 12).join(', ') + (c.others.length > 12 ? ` +${c.others.length - 12} more` : ''))}">${c.others.length} other ${c.others.length === 1 ? 'ingredient is not a fragrance material' : 'ingredients are not fragrance materials'}. Not checked.</div>` : ''}
720
723
  </div></div>`;
@@ -749,7 +752,7 @@ function flFrTabHtml(f) {
749
752
  <div class="card"><div class="card-header"><h2>IFRA</h2></div>
750
753
  <div class="card-body">${_frgVerdictHtml(c)}${_frgMaxHtml(c)}${_frgIfraTableHtml(c)}</div></div>
751
754
  <div class="card"><div class="card-header"><h2>Allergens <span class="nl-sub">EU</span></h2></div>
752
- <div class="card-body">${c.use ? `<div class="fr-dim fr-lead">${c.toLabel.length ? `<strong>${c.toLabel.length} to name on the label</strong> (above ${FL_FR_LABEL_OVER[c.use]}% ${c.use}).` : `None above ${FL_FR_LABEL_OVER[c.use]}% ${c.use}.`}${c.noDecl.length ? ' Incomplete: ' + c.noDecl.length + ' without a declaration.' : ''}</div>` : '<div class="fr-dim fr-lead">Choose leave-on or rinse-off to see which to label.</div>'}
755
+ <div class="card-body">${c.use ? `<div class="fr-dim fr-lead">${c.toLabel.length ? `<strong>${c.toLabel.length} to name on the label</strong> (above ${FL_FR_LABEL_OVER[c.use]}% ${c.use}).` : `None above ${FL_FR_LABEL_OVER[c.use]}% ${c.use}.`}${c.noDecl.length ? ' Incomplete: ' + c.noDecl.length + ' without a declaration.' : ''}</div>` : `<div class="fr-dim fr-lead">${c.useApplies ? 'Choose leave-on or rinse-off to see which to label.' : 'Cosmetic allergen labelling does not apply to category 12 (no skin contact).'}</div>`}
753
756
  ${_frgAllergenTableHtml(c)}
754
757
  <div class="fr-dim fr-legal">Based on the certificates and declarations on file. Not a certification.</div></div></div>
755
758
  </div>