@endiagram/mcp 0.2.18 → 0.2.20
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/dist/index.js +1 -4
- package/package.json +1 -1
- package/tools.json +25 -83
package/dist/index.js
CHANGED
|
@@ -56,10 +56,7 @@ async function callApi(toolName, args) {
|
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
const EN_INSTRUCTIONS = toolsConfig.instructions;
|
|
59
|
-
const server = new McpServer({
|
|
60
|
-
name: "endiagram",
|
|
61
|
-
version: "0.2.0",
|
|
62
|
-
});
|
|
59
|
+
const server = new McpServer({ name: "endiagram", version: "0.2.0" }, { instructions: EN_INSTRUCTIONS });
|
|
63
60
|
for (const tool of toolsConfig.tools) {
|
|
64
61
|
const schemaProps = {};
|
|
65
62
|
for (const param of tool.parameters) {
|
package/package.json
CHANGED
package/tools.json
CHANGED
|
@@ -1,116 +1,59 @@
|
|
|
1
1
|
{
|
|
2
|
-
"instructions": "EN Diagram is a
|
|
2
|
+
"instructions": "EN Diagram is a structural verification engine for concurrent systems. No AI inside.\n\nTo describe a system, write one statement per line:\n actor do: action needs: input1, input2 yields: output1, output2 at: context\n\nShared names between yields and needs create connections automatically. Multi-word names work fine. Use commas to separate multiple inputs or outputs. at: scopes the action to a context (service, team, region, domain, layer — whatever boundary fits the system).\n\nSix tools answer six questions from concurrency theory. Each answer includes who (actors) and where (locations) alongside the structural findings.\n\n1. structure — what is this system?\n2. invariant — what's always true?\n3. live — can it deadlock? can entities overflow?\n4. reachable — can X reach Y?\n5. equivalent — are two systems the same?\n6. compose — how do parts combine?\n\nEvery tool output contains node names, values, and structural properties that can be fed directly into other tools. Read the output. Find the surprising node, the unexpected value, the structural anomaly. Then pick the tool that investigates THAT specific finding.\n\nDo not stop at one tool call. The first call reveals the structure — the real insight comes from the second, third, fourth call that digs into what the first one found.\n\nSpeak in the user's domain, not in graph theory. Only call render when the user explicitly asks to visualize.",
|
|
3
3
|
"tools": [
|
|
4
4
|
{
|
|
5
|
-
"name": "
|
|
6
|
-
"description": "
|
|
5
|
+
"name": "structure",
|
|
6
|
+
"description": "What is this system? Complete structural overview: shape (topology), stages with roles, bridge nodes, cycles, parallelism, critical path, dominator tree, min-cuts, subsystems, interface nodes. Includes actors (who does what, workload entropy) and locations (where work happens, boundary crossings). Optional: pass node for per-node centrality, detect_findings for structural pattern detection.",
|
|
7
7
|
"parameters": [
|
|
8
8
|
{"name": "source", "type": "string", "description": "EN source code describing the system", "required": true},
|
|
9
|
-
{"name": "
|
|
9
|
+
{"name": "node", "type": "string", "description": "Node name for centrality query", "required": false},
|
|
10
10
|
{"name": "detect_findings", "type": "string", "description": "Set to 'true' to detect structural findings", "required": false}
|
|
11
11
|
]
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
|
-
"name": "
|
|
15
|
-
"description": "
|
|
14
|
+
"name": "invariant",
|
|
15
|
+
"description": "What's always true? conservationLaws are weighted entity sums constant across all executions. sustainableCycles are action sequences that return the system to its starting state (T-invariants). depletableSets are entity groups where simultaneous depletion is irreversible. behavioral.deficiency 0 means structure fully determines dynamics. behavioral.isReversible and behavioral.hasUniqueEquilibrium describe convergence properties.",
|
|
16
16
|
"parameters": [
|
|
17
|
-
{"name": "source", "type": "string", "description": "EN source code describing the system", "required": true}
|
|
17
|
+
{"name": "source", "type": "string", "description": "EN source code describing the system", "required": true},
|
|
18
|
+
{"name": "rules", "type": "string", "description": "Structural rules to check, one per line", "required": false}
|
|
18
19
|
]
|
|
19
20
|
},
|
|
20
21
|
{
|
|
21
|
-
"name": "
|
|
22
|
-
"description": "
|
|
22
|
+
"name": "live",
|
|
23
|
+
"description": "Can it deadlock? Can entities overflow? isStructurallyLive means every siphon contains a trap — no structural deadlock possible. uncoveredSiphons are entity groups that can drain permanently, with the actors and locations affected. isStructurallyBounded means no entity can accumulate without limit. unboundedCycles are action sequences that could cause overflow.",
|
|
23
24
|
"parameters": [
|
|
24
25
|
{"name": "source", "type": "string", "description": "EN source code describing the system", "required": true}
|
|
25
26
|
]
|
|
26
27
|
},
|
|
27
28
|
{
|
|
28
|
-
"name": "
|
|
29
|
-
"description": "
|
|
30
|
-
"parameters": [
|
|
31
|
-
{"name": "source", "type": "string", "description": "EN source code", "required": true},
|
|
32
|
-
{"name": "from", "type": "string", "description": "Starting node name", "required": true},
|
|
33
|
-
{"name": "to", "type": "string", "description": "Target node name", "required": true}
|
|
34
|
-
]
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
"name": "diff",
|
|
38
|
-
"description": "Compare two systems structurally. Output shows nodes, entities, roles, and subsystems that differ. editDistance is the total graph edit cost (sum of node insertions + deletions + edge insertions + deletions). spectralEquivalence compares the mathematical structure independent of naming — isCospectral true means two systems have identical structural properties despite different names; spectrumDistance 0.0 means identical topology.",
|
|
39
|
-
"parameters": [
|
|
40
|
-
{"name": "source_a", "type": "string", "description": "EN source code for the first system", "required": true},
|
|
41
|
-
{"name": "source_b", "type": "string", "description": "EN source code for the second system", "required": true}
|
|
42
|
-
]
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
"name": "trace",
|
|
46
|
-
"description": "Follow directed data flow from A to B. Tries directed path first (needs to action to yields); falls back to undirected if no directed path exists (usesReverseEdges=true). Optional: defense_nodes checks if at least one guard node sits on every source-to-sink path.",
|
|
29
|
+
"name": "reachable",
|
|
30
|
+
"description": "Can X reach Y? Follows directed data flow first; falls back to undirected. Path shows each step with actor and location. locationCrossings counts boundary transitions. defense_nodes checks if guards cover all paths. coverage.fullCoverage false means unguarded routes exist.",
|
|
47
31
|
"parameters": [
|
|
48
32
|
{"name": "source", "type": "string", "description": "EN source code", "required": true},
|
|
49
33
|
{"name": "from", "type": "string", "description": "Starting node name", "required": true},
|
|
50
34
|
{"name": "to", "type": "string", "description": "Target node name", "required": true},
|
|
51
|
-
{"name": "defense_nodes", "type": "string", "description": "Comma-separated
|
|
52
|
-
]
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
"name": "between",
|
|
56
|
-
"description": "How much of the system's flow passes through one node. Output: centrality is 0-1 normalized — fraction of all shortest paths in the graph that cross this node. Values above 0.3 indicate a structural coupling point; above 0.5 is a major hub. pathsThrough is the absolute count, totalPaths is the denominator.",
|
|
57
|
-
"parameters": [
|
|
58
|
-
{"name": "source", "type": "string", "description": "EN source code", "required": true},
|
|
59
|
-
{"name": "node", "type": "string", "description": "Node name", "required": true}
|
|
60
|
-
]
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
"name": "extract",
|
|
64
|
-
"description": "Extract a subsystem as standalone EN source. boundaryInputs are entities consumed but not produced within the subsystem. boundaryOutputs are entities produced but not consumed within. Feed the extracted EN back into other tools for deeper analysis.",
|
|
65
|
-
"parameters": [
|
|
66
|
-
{"name": "source", "type": "string", "description": "EN source code", "required": true},
|
|
67
|
-
{"name": "subsystem", "type": "string", "description": "Name of the subsystem to extract", "required": true}
|
|
68
|
-
]
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
"name": "impact",
|
|
72
|
-
"description": "Remove a node and measure structural effect. Output: disconnectedNodes are actions that lose their sole input source. propagation shows how disruption spreads through the graph — higher diffusion means more structural proximity to the removed node.",
|
|
73
|
-
"parameters": [
|
|
74
|
-
{"name": "source", "type": "string", "description": "EN source code", "required": true},
|
|
75
|
-
{"name": "node", "type": "string", "description": "Node to remove", "required": true}
|
|
35
|
+
{"name": "defense_nodes", "type": "string", "description": "Comma-separated guard nodes to check coverage", "required": false}
|
|
76
36
|
]
|
|
77
37
|
},
|
|
78
38
|
{
|
|
79
|
-
"name": "
|
|
80
|
-
"description": "
|
|
39
|
+
"name": "equivalent",
|
|
40
|
+
"description": "Are two systems the same? Compare mode (source_a + source_b): shows structural differences, edit distance, and spectral equivalence — isCospectral true means identical structure despite different names. Evolve mode (source + patch): dry-run a change, shows diff plus new/lost bridge nodes. Prefix action name with - in patch to remove it.",
|
|
81
41
|
"parameters": [
|
|
82
|
-
{"name": "
|
|
83
|
-
{"name": "
|
|
42
|
+
{"name": "source_a", "type": "string", "description": "EN source code for the first system", "required": false},
|
|
43
|
+
{"name": "source_b", "type": "string", "description": "EN source code for the second system", "required": false},
|
|
44
|
+
{"name": "source", "type": "string", "description": "EN source code for evolve mode", "required": false},
|
|
45
|
+
{"name": "patch", "type": "string", "description": "EN patch for evolve mode", "required": false}
|
|
84
46
|
]
|
|
85
47
|
},
|
|
86
48
|
{
|
|
87
49
|
"name": "compose",
|
|
88
|
-
"description": "
|
|
50
|
+
"description": "How do parts combine? Merge mode (source_a + source_b + links): merge two systems by linking shared entities. Extract mode (source + subsystem): extract a subsystem as standalone EN with boundary inputs/outputs, actors, and locations.",
|
|
89
51
|
"parameters": [
|
|
90
|
-
{"name": "source_a", "type": "string", "description": "EN source code for the first system", "required":
|
|
91
|
-
{"name": "source_b", "type": "string", "description": "EN source code for the second system", "required":
|
|
92
|
-
{"name": "links", "type": "string", "description": "Entity links e.g. 'a.node1=b.node2
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
{
|
|
96
|
-
"name": "conserve",
|
|
97
|
-
"description": "Structural invariants, deadlock analysis, complexity, and resilience. Output: invariants are weighted entity sums that stay constant across all executions — positive coefficient means produced, negative means consumed in that ratio. depletableSets are entity groups where simultaneous depletion is irreversible. entropy is normalized structural disorder 0-1. nodeRemovalThreshold is the fraction of random node removals before fragmentation. behavioral.deficiency 0 means structure fully determines execution dynamics. behavioral.isReversible means every reachable state can return to any prior state. behavioral.hasUniqueEquilibrium means convergence to one steady state regardless of initial conditions.",
|
|
98
|
-
"parameters": [
|
|
99
|
-
{"name": "source", "type": "string", "description": "EN source code describing the system", "required": true}
|
|
100
|
-
]
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
"name": "responsibility",
|
|
104
|
-
"description": "Who does what. Output: actors lists each actor with their actionCount and the entities their actions touch. coAction lists actor pairs sharing actions (from the actor co-action matrix). workloadEntropy is 0-1 normalized — 0 means all work on one actor, 1 means perfectly even distribution.",
|
|
105
|
-
"parameters": [
|
|
106
|
-
{"name": "source", "type": "string", "description": "EN source code describing the system", "required": true}
|
|
107
|
-
]
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
"name": "locality",
|
|
111
|
-
"description": "Where work happens. Output: locations lists each location with actionCount and entities handled there. coLocation lists location pairs sharing actions. boundaryCrossings counts entity flows where the producing action and consuming action are at different locations. localityEntropy is 0-1 normalized — 0 means all actions at one location, 1 means perfectly distributed.",
|
|
112
|
-
"parameters": [
|
|
113
|
-
{"name": "source", "type": "string", "description": "EN source code describing the system", "required": true}
|
|
52
|
+
{"name": "source_a", "type": "string", "description": "EN source code for the first system", "required": false},
|
|
53
|
+
{"name": "source_b", "type": "string", "description": "EN source code for the second system", "required": false},
|
|
54
|
+
{"name": "links", "type": "string", "description": "Entity links e.g. 'a.node1=b.node2'", "required": false},
|
|
55
|
+
{"name": "source", "type": "string", "description": "EN source code for extract mode", "required": false},
|
|
56
|
+
{"name": "subsystem", "type": "string", "description": "Subsystem name for extract mode", "required": false}
|
|
114
57
|
]
|
|
115
58
|
},
|
|
116
59
|
{
|
|
@@ -124,4 +67,3 @@
|
|
|
124
67
|
}
|
|
125
68
|
]
|
|
126
69
|
}
|
|
127
|
-
|