formlab-mcp 0.6.74 → 0.6.75
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 +1 -1
- package/server.json +2 -2
- package/tools/discussions.js +8 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "formlab-mcp",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.75",
|
|
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.6.
|
|
5
|
+
"version": "0.6.75",
|
|
6
6
|
"websiteUrl": "https://formvix.com/mcp",
|
|
7
7
|
"packages": [
|
|
8
8
|
{
|
|
9
9
|
"registryType": "npm",
|
|
10
10
|
"identifier": "formlab-mcp",
|
|
11
|
-
"version": "0.6.
|
|
11
|
+
"version": "0.6.75",
|
|
12
12
|
"runtimeHint": "npx",
|
|
13
13
|
"transport": {
|
|
14
14
|
"type": "stdio"
|
package/tools/discussions.js
CHANGED
|
@@ -17,7 +17,9 @@ const _COLL = {
|
|
|
17
17
|
ingredient: 'ingredients', equipment: 'equipment', parameter: 'parameters', template: 'templates', lot: 'lots', doeDesign: 'doeDesigns',
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
-
function _record(type, id, db) {
|
|
20
|
+
function _record(type, id, db, viewName) {
|
|
21
|
+
// VT (0225): a shared saved view (view:doe, view:compare, …): its name, kept with each comment.
|
|
22
|
+
if (/^view:/.test(String(type || ''))) return { uid: null, name: viewName || 'a shared view' };
|
|
21
23
|
if (type === 'request') {
|
|
22
24
|
const r = (db.requests || []).find(x => x && x.id === id);
|
|
23
25
|
return r ? { uid: r.uid, name: r.title } : null;
|
|
@@ -42,11 +44,11 @@ function _notLive(db) {
|
|
|
42
44
|
const list_discussions = {
|
|
43
45
|
definition: {
|
|
44
46
|
name: 'list_discussions',
|
|
45
|
-
description: 'List discussion comments that sit beside records (formulas, batches, samples, test reports, projects, ingredients, equipment) or work requests — optionally filtered by the record (entity_type + entity_id, UID accepted), author, text, date, or only unresolved threads. Grouped by thread by default (each thread: the record, resolved or not, its comments oldest first); flat=true returns comments newest first. Comments are append-only: a retracted one keeps retracted = {at, reason} — treat it as withdrawn, not as a finding. "tab" says which tab of the record the comment was written on.',
|
|
47
|
+
description: 'List discussion comments that sit beside records (formulas, batches, samples, test reports, projects, ingredients, equipment), shared saved views (entity_type view:doe, view:compare, view:stability, view:test-analytics, view:find; entityName is the view name) or work requests — optionally filtered by the record (entity_type + entity_id, UID accepted), author, text, date, or only unresolved threads. Grouped by thread by default (each thread: the record, resolved or not, its comments oldest first); flat=true returns comments newest first. Comments are append-only: a retracted one keeps retracted = {at, reason} — treat it as withdrawn, not as a finding. "tab" says which tab of the record the comment was written on.',
|
|
46
48
|
inputSchema: {
|
|
47
49
|
type: 'object',
|
|
48
50
|
properties: {
|
|
49
|
-
entity_type: { type: 'string', description: 'formulation, batch, sample, testResult, project, ingredient, equipment, or
|
|
51
|
+
entity_type: { type: 'string', description: 'formulation, batch, sample, testResult, project, ingredient, equipment, request, or a shared saved view (view:doe, view:compare, view:stability, view:test-analytics, view:find; entity_id = the view\'s id).' },
|
|
50
52
|
entity_id: { type: 'string', description: 'The record (internal id or UID, e.g. FORM-0012, REQ-0003).' },
|
|
51
53
|
author: { type: 'string', description: 'Case-insensitive substring of the author\'s name.' },
|
|
52
54
|
text_contains: { type: 'string', description: 'Case-insensitive substring of the comment text.' },
|
|
@@ -77,13 +79,13 @@ const list_discussions = {
|
|
|
77
79
|
const flat = [...threads.values()].filter(l => !args.open_only || !resolvedOf(l)).flat().filter(keep)
|
|
78
80
|
.sort((a, b) => Date.parse(b.at) - Date.parse(a.at));
|
|
79
81
|
return { totalMatching: flat.length, returned: Math.min(flat.length, limit),
|
|
80
|
-
comments: flat.slice(0, limit).map(c => { const rec = _record(c.entityType, c.entityId, db);
|
|
82
|
+
comments: flat.slice(0, limit).map(c => { const rec = _record(c.entityType, c.entityId, db, c.viewName);
|
|
81
83
|
return { ...row(c), entityType: c.entityType, entityId: c.entityId, entityUid: rec ? rec.uid : null, entityName: rec ? rec.name : '' }; }) };
|
|
82
84
|
}
|
|
83
85
|
const out = [...threads.values()].map(list => {
|
|
84
86
|
const comments = list.filter(keep);
|
|
85
87
|
if (!comments.length) return null;
|
|
86
|
-
const c0 = list[0], rec = _record(c0.entityType, c0.entityId, db), resolved = resolvedOf(list);
|
|
88
|
+
const c0 = list[0], rec = _record(c0.entityType, c0.entityId, db, (list.find(c => c.viewName) || {}).viewName), resolved = resolvedOf(list);
|
|
87
89
|
if (args.open_only && resolved) return null;
|
|
88
90
|
return { entityType: c0.entityType, entityId: c0.entityId, entityUid: rec ? rec.uid : null, entityName: rec ? rec.name : '',
|
|
89
91
|
resolved, lastAt: list[list.length - 1].at, comments: comments.map(row) };
|
|
@@ -102,7 +104,7 @@ const list_requests = {
|
|
|
102
104
|
status: { type: 'string', description: 'open, in_progress, blocked, done, cancelled; or "active" for open + in_progress + blocked.' },
|
|
103
105
|
assignee: { type: 'string', description: 'Case-insensitive substring of the name of the person it is asked of.' },
|
|
104
106
|
kind: { type: 'string', description: 'batch, tests, samples, review, other.' },
|
|
105
|
-
entity_type: { type: 'string', description: 'The linked record\'s type (formulation, batch, sample, testResult, project).' },
|
|
107
|
+
entity_type: { type: 'string', description: 'The linked record\'s type (formulation, batch, sample, testResult, project), or a shared saved view (view:doe, view:compare, …).' },
|
|
106
108
|
entity_id: { type: 'string', description: 'The linked record (internal id or UID).' },
|
|
107
109
|
late_only: { type: 'boolean', description: 'true = only active requests past their due date.' },
|
|
108
110
|
limit: { type: 'number', description: 'Max rows (default 100, max 1000).' },
|