@burdenoff/mcp-libs 2026.1101.1 → 2026.1101.2

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.
Files changed (40) hide show
  1. package/README.md +30 -0
  2. package/dist/modules/adaptercloud/tools/shared.d.ts +91 -13
  3. package/dist/modules/artistrybase/tools/shared.d.ts +80 -12
  4. package/dist/modules/assethandler/tools/shared.d.ts +52 -8
  5. package/dist/modules/atheletebridge/tools/shared.d.ts +83 -12
  6. package/dist/modules/brainyrich/tools/shared.d.ts +102 -14
  7. package/dist/modules/buildmyiq/tools/shared.d.ts +75 -12
  8. package/dist/modules/collabkin/tools/shared.d.ts +66 -10
  9. package/dist/modules/comradecircle/tools/shared.d.ts +78 -14
  10. package/dist/modules/coolandlovely/tools/shared.d.ts +76 -19
  11. package/dist/modules/cosmicintersection/tools/shared.d.ts +94 -13
  12. package/dist/modules/ecoimpacthub/tools/shared.d.ts +130 -17
  13. package/dist/modules/fluidgrids/durable-operations.d.ts +23 -0
  14. package/dist/modules/fluidgrids/index.cjs +566 -13
  15. package/dist/modules/fluidgrids/index.cjs.map +1 -1
  16. package/dist/modules/fluidgrids/index.js +490 -12
  17. package/dist/modules/fluidgrids/index.js.map +1 -1
  18. package/dist/modules/fluidgrids/operations.d.ts +4 -3
  19. package/dist/modules/fluidgrids/tools/durable.d.ts +3 -0
  20. package/dist/modules/ggnomad/tools/shared.d.ts +23 -3
  21. package/dist/modules/govcitizenhub/tools/shared.d.ts +68 -10
  22. package/dist/modules/headshotmarketing/tools/shared.d.ts +299 -42
  23. package/dist/modules/healthybowl/tools/shared.d.ts +5 -1
  24. package/dist/modules/hookmovies/tools/shared.d.ts +93 -13
  25. package/dist/modules/housingvista/tools/shared.d.ts +15 -2
  26. package/dist/modules/intelwatchtower/tools/shared.d.ts +121 -16
  27. package/dist/modules/kadaikodi/tools/shared.d.ts +52 -7
  28. package/dist/modules/labsofscience/tools/shared.d.ts +85 -13
  29. package/dist/modules/manufacturedops/tools/shared.d.ts +95 -14
  30. package/dist/modules/movethewheels/tools/shared.d.ts +111 -14
  31. package/dist/modules/mybodyshield/tools/shared.d.ts +84 -12
  32. package/dist/modules/planmagnet/tools/shared.d.ts +231 -31
  33. package/dist/modules/proserviceworld/tools/shared.d.ts +53 -9
  34. package/dist/modules/semanticfed/tools/shared.d.ts +87 -12
  35. package/dist/modules/subscriberbot/tools/shared.d.ts +157 -19
  36. package/dist/modules/technospam/tools/shared.d.ts +63 -10
  37. package/dist/modules/theculturepost/tools/shared.d.ts +63 -8
  38. package/dist/modules/theglobalfuel/tools/shared.d.ts +117 -14
  39. package/dist/modules/timecampus/tools/shared.d.ts +131 -21
  40. package/package.json +16 -15
@@ -10,6 +10,22 @@ require('crypto');
10
10
  // src/modules/fluidgrids/tools/credentials.ts
11
11
 
12
12
  // src/core/errors.ts
13
+ var McpUserError = class extends Error {
14
+ hint;
15
+ constructor(message, opts) {
16
+ super(message);
17
+ this.name = "McpUserError";
18
+ this.hint = opts?.hint;
19
+ }
20
+ };
21
+ var McpAuthError = class extends McpUserError {
22
+ constructor(message, opts) {
23
+ super(message, {
24
+ hint: opts?.hint ?? "Run the auth_login tool to authenticate."
25
+ });
26
+ this.name = "McpAuthError";
27
+ }
28
+ };
13
29
  var McpInternalError = class extends Error {
14
30
  cause;
15
31
  constructor(message, cause) {
@@ -56,13 +72,219 @@ function jsonResult(data, structured) {
56
72
  };
57
73
  return result;
58
74
  }
75
+ function textResult(text2) {
76
+ return { content: [{ type: "text", text: text2 }] };
77
+ }
59
78
  function errorResult(message, hint) {
60
- const text = hint ? `${message}
79
+ const text2 = hint ? `${message}
61
80
 
62
81
  Hint: ${hint}` : message;
63
- return { content: [{ type: "text", text }], isError: true };
82
+ return { content: [{ type: "text", text: text2 }], isError: true };
83
+ }
84
+ function registerTool(server, ctx, name, metadata, handler) {
85
+ const sdkConfig = {
86
+ title: metadata.title,
87
+ description: metadata.description,
88
+ ...metadata.inputSchema ? { inputSchema: metadata.inputSchema } : {},
89
+ ...metadata.annotations ? { annotations: metadata.annotations } : {}
90
+ };
91
+ const wrapped = async (...callbackArgs) => {
92
+ const hasArgs = callbackArgs.length === 2;
93
+ const args = hasArgs ? callbackArgs[0] : {};
94
+ const extra = hasArgs ? callbackArgs[1] : callbackArgs[0];
95
+ const progressToken = extra?._meta?.progressToken;
96
+ const meta = progressToken !== void 0 ? { progressToken } : {};
97
+ try {
98
+ const result = await handler(args, ctx, meta);
99
+ if (isToolResult(result)) return result;
100
+ if (result === void 0) return textResult("OK");
101
+ return jsonResult(result);
102
+ } catch (error) {
103
+ return mapErrorToResult(error, ctx, name);
104
+ }
105
+ };
106
+ server.registerTool(name, sdkConfig, wrapped);
107
+ }
108
+ function isToolResult(value) {
109
+ return !!value && typeof value === "object" && "content" in value && Array.isArray(value.content);
110
+ }
111
+ function mapErrorToResult(error, ctx, toolName) {
112
+ if (error instanceof McpAuthError) {
113
+ ctx.logger.warn(`${toolName}: auth required`, { message: error.message });
114
+ return errorResult(error.message, error.hint);
115
+ }
116
+ if (error instanceof McpUserError) {
117
+ ctx.logger.info(`${toolName}: user error`, { message: error.message });
118
+ return errorResult(error.message, error.hint);
119
+ }
120
+ if (error instanceof McpInternalError) {
121
+ ctx.logger.error(`${toolName}: internal error`, {
122
+ message: error.message,
123
+ cause: stringifyCause(error.cause)
124
+ });
125
+ return errorResult(`Internal error in ${toolName}.`);
126
+ }
127
+ const message = error instanceof Error ? error.message : String(error);
128
+ ctx.logger.error(`${toolName}: unhandled error`, { message });
129
+ return errorResult(`${toolName}: ${message}`);
130
+ }
131
+ function stringifyCause(cause) {
132
+ if (cause === void 0 || cause === null) return void 0;
133
+ if (cause instanceof Error) return cause.message;
134
+ try {
135
+ return JSON.stringify(cause);
136
+ } catch {
137
+ return String(cause);
138
+ }
64
139
  }
65
140
 
141
+ // src/modules/fluidgrids/durable-operations.ts
142
+ var WORKFLOW_FIELDS = `id workflowKey name description version status category tags icon isActive totalVersions createdAt updatedAt`;
143
+ var RUN_FIELDS = `
144
+ id workflowId workflowKey version status startedAt completedAt duration errorMessage
145
+ executionKind workflowFn taskQueue buildId historyLength parentClosePolicy cancelRequestedAt
146
+ determinism { failing cause attempts since lastFailureSeq message }
147
+ `;
148
+ var PARITY_FIELDS = `${RUN_FIELDS}
149
+ businessId runAttempt firstRunId continuedFromRunId continuedToRunId priority
150
+ summary details currentDetails memo startDelayUntil runTimeoutAt executionTimeoutAt
151
+ `;
152
+ var PENDING_FIELDS = `
153
+ activities { activityId activityType state attempt maxAttempts scheduledAt lastStartedAt
154
+ lastHeartbeatAt heartbeatDetails lastFailure nextAttemptAt summary }
155
+ children { runId workflowKey version status startedAt }
156
+ timers { timerId fireAt summary }
157
+ bufferedSignals workflowTask { state attempt startedAt failureCause }
158
+ `;
159
+ var EXPORT_WORKFLOW = `
160
+ query FluidgridsExportWorkflow($workflowKey: String!, $version: String, $format: WorkflowExportFormat, $options: ExportOptionsInput) {
161
+ exportWorkflow(workflowKey: $workflowKey, version: $version, format: $format, options: $options) {
162
+ format schemaVersion exportedAt workflowKey version name description definitionJson context tags icon category
163
+ nodeReferences { nodeId nodeType nodeVersion }
164
+ exportFormat files { path contentType content url }
165
+ fidelity { level items { nodeId path kind detail } } irHash
166
+ }
167
+ }
168
+ `;
169
+ var IMPORT_WORKFLOW = `
170
+ mutation FluidgridsImportWorkflow($input: ImportWorkflowInput!) {
171
+ importWorkflow(input: $input) {
172
+ success message workflow { ${WORKFLOW_FIELDS} }
173
+ validation { valid errors warnings missingNodes { nodeId nodeType nodeVersion } }
174
+ }
175
+ }
176
+ `;
177
+ var IMPORT_WORKFLOW_TEMPLATE = `
178
+ mutation FluidgridsImportWorkflowTemplate($input: ImportWorkflowTemplateInput!) {
179
+ importWorkflowTemplate(input: $input) { success message workflow { ${WORKFLOW_FIELDS} } }
180
+ }
181
+ `;
182
+ var CREATE_WORKFLOW_VERSION = `
183
+ mutation FluidgridsCreateWorkflowVersion($workflowKey: String!, $input: CreateWorkflowVersionInput!) {
184
+ createWorkflowVersion(workflowKey: $workflowKey, input: $input) {
185
+ success message workflow { ${WORKFLOW_FIELDS} }
186
+ }
187
+ }
188
+ `;
189
+ var VALIDATE_WORKFLOW_DEFINITION = `
190
+ query FluidgridsValidateWorkflowDefinition($definitionJson: JSON!, $strict: Boolean) {
191
+ validateWorkflowDefinition(definitionJson: $definitionJson, strict: $strict) {
192
+ valid errors { code message nodeId path } warnings { code message nodeId path }
193
+ schemaVersion irHash taskQueues
194
+ }
195
+ }
196
+ `;
197
+ var WORKFLOW_INTERFACE = `
198
+ query FluidgridsWorkflowInterface($workflowKey: String!, $version: String) {
199
+ workflowInterface(workflowKey: $workflowKey, version: $version)
200
+ }
201
+ `;
202
+ var START_WORKFLOW = `
203
+ mutation FluidgridsStartWorkflow($input: StartWorkflowInput!) {
204
+ startWorkflow(input: $input) { run { ${RUN_FIELDS} } existing }
205
+ }
206
+ `;
207
+ var START_WORKFLOW_PARITY = `
208
+ mutation FluidgridsStartWorkflowParity($input: StartWorkflowInput!) {
209
+ startWorkflow(input: $input) { run { ${PARITY_FIELDS} } existing }
210
+ }
211
+ `;
212
+ var START_WORKFLOW_TERMINATE_EXISTING = `
213
+ mutation FluidgridsStartWorkflowTerminateExisting($input: StartWorkflowInput!) {
214
+ startWorkflowTerminateExisting(input: $input) { run { ${PARITY_FIELDS} } existing }
215
+ }
216
+ `;
217
+ var DESCRIBE_RUN = `
218
+ query FluidgridsDescribeRun($id: ID!) { workflowRun(id: $id) { ${RUN_FIELDS} } }
219
+ `;
220
+ var RUN_BY_WORKFLOW_ID = `
221
+ query FluidgridsRunByWorkflowId($workflowKey: String!, $workflowId: String!, $firstRunId: ID) {
222
+ workflowRunByWorkflowId(workflowKey: $workflowKey, workflowId: $workflowId, firstRunId: $firstRunId) { ${PARITY_FIELDS} }
223
+ }
224
+ `;
225
+ var RUN_PENDING = `
226
+ query FluidgridsRunPending($id: ID!) { workflowRun(id: $id) { id status pending { ${PENDING_FIELDS} } } }
227
+ `;
228
+ var RUN_PENDING_BY_WORKFLOW_ID = `
229
+ query FluidgridsRunPendingByWorkflowId($workflowKey: String!, $workflowId: String!, $firstRunId: ID) {
230
+ workflowRunByWorkflowId(workflowKey: $workflowKey, workflowId: $workflowId, firstRunId: $firstRunId) { id status pending { ${PENDING_FIELDS} } }
231
+ }
232
+ `;
233
+ var RUNS_COUNT = `
234
+ query FluidgridsRunsCount($filter: ListWorkflowRunsInput, $groupBy: [RunGroupBy!]) {
235
+ workflowRunsCount(filter: $filter, groupBy: $groupBy) { total groups { key values count } groupsTruncated }
236
+ }
237
+ `;
238
+ var HISTORY_FIELDS = `events { runId seq type taskId payload payloadUrl createdAt } nextAfter hasMore historyLength historyBytes`;
239
+ var RUN_HISTORY = `
240
+ query FluidgridsRunHistory($runId: ID!, $after: Int, $limit: Int) {
241
+ workflowRunHistory(runId: $runId, after: $after, limit: $limit) { ${HISTORY_FIELDS} }
242
+ }
243
+ `;
244
+ var RUN_HISTORY_BY_TARGET = `
245
+ query FluidgridsRunHistoryByTarget($target: RunTargetInput!, $after: Int, $limit: Int) {
246
+ workflowRunHistory(target: $target, after: $after, limit: $limit) { ${HISTORY_FIELDS} }
247
+ }
248
+ `;
249
+ var SIGNAL_FIELDS = `accepted delivered buffered forwardedToRunId seq duplicate`;
250
+ var SIGNAL_RUN = `
251
+ mutation FluidgridsSignalRun($runId: ID!, $name: String!, $payload: JSON, $idempotencyKey: String) {
252
+ signalWorkflowRun(runId: $runId, name: $name, payload: $payload, idempotencyKey: $idempotencyKey) { ${SIGNAL_FIELDS} }
253
+ }
254
+ `;
255
+ var SIGNAL_RUN_BY_TARGET = `
256
+ mutation FluidgridsSignalRunByTarget($target: RunTargetInput!, $name: String!, $payload: JSON, $idempotencyKey: String) {
257
+ signalWorkflowRun(target: $target, name: $name, payload: $payload, idempotencyKey: $idempotencyKey) { ${SIGNAL_FIELDS} }
258
+ }
259
+ `;
260
+ var RUN_STACK_TRACE = `
261
+ query FluidgridsRunStackTrace($runId: ID!, $enhanced: Boolean) {
262
+ workflowRunStackTrace(runId: $runId, enhanced: $enhanced) { trace enhanced }
263
+ }
264
+ `;
265
+ var RUN_STACK_TRACE_PARITY = `
266
+ query FluidgridsRunStackTraceParity($runId: ID, $target: RunTargetInput, $enhanced: Boolean, $metadata: Boolean) {
267
+ workflowRunStackTrace(runId: $runId, target: $target, enhanced: $enhanced, metadata: $metadata) {
268
+ trace enhanced metadata { definition currentDetails }
269
+ }
270
+ }
271
+ `;
272
+ var RUN_DETERMINISM_STATUS = `
273
+ query FluidgridsRunDeterminismStatus($runId: ID!) {
274
+ workflowRunDeterminismStatus(runId: $runId) { failing cause attempts since lastFailureSeq message }
275
+ }
276
+ `;
277
+ var TERMINATE_RUN = `
278
+ mutation FluidgridsTerminateRun($runId: ID!, $reason: String) {
279
+ terminateWorkflowRun(runId: $runId, reason: $reason) { id status completedAt errorMessage }
280
+ }
281
+ `;
282
+ var TERMINATE_RUN_BY_TARGET = `
283
+ mutation FluidgridsTerminateRunByTarget($target: RunTargetInput!, $reason: String) {
284
+ terminateWorkflowRun(target: $target, reason: $reason) { id status completedAt errorMessage }
285
+ }
286
+ `;
287
+
66
288
  // src/modules/fluidgrids/operations.ts
67
289
  var LIST_WORKFLOWS = `
68
290
  query ListWorkflows($input: ListWorkflowDefinitionsInput!) {
@@ -172,6 +394,7 @@ var GET_RUN = `
172
394
  failedNodes
173
395
  skippedNodes
174
396
  nodeStates {
397
+ id
175
398
  nodeId
176
399
  nodeType
177
400
  status
@@ -778,8 +1001,8 @@ var RESUME_RUN = `
778
1001
  }
779
1002
  `;
780
1003
  var RETRY_RUN = `
781
- mutation RetryNode($id: ID!) {
782
- retryNode(id: $id) {
1004
+ mutation RetryNode($id: ID!, $nodeId: String!) {
1005
+ retryNode(id: $id, nodeId: $nodeId) {
783
1006
  id
784
1007
  nodeId
785
1008
  nodeType
@@ -933,8 +1156,8 @@ var CREATE_SCHEDULED_JOB = `
933
1156
  }
934
1157
  `;
935
1158
  var UPDATE_SCHEDULED_JOB = `
936
- mutation UpdateScheduledJob($id: ID!, $input: WorkflowUpdateScheduledJobInput!) {
937
- updateWorkflowScheduledJob(id: $id, input: $input) {
1159
+ mutation UpdateScheduledJob($jobId: ID!, $input: WorkflowUpdateScheduledJobInput!) {
1160
+ updateWorkflowScheduledJob(jobId: $jobId, input: $input) {
938
1161
  success
939
1162
  message
940
1163
  job {
@@ -978,9 +1201,9 @@ function safeErrorMessage(error) {
978
1201
  }
979
1202
  return error instanceof Error ? error.message : String(error);
980
1203
  }
981
- async function runTool(ctx, label, run) {
1204
+ async function runTool(ctx, label, run2) {
982
1205
  try {
983
- return await run();
1206
+ return await run2();
984
1207
  } catch (error) {
985
1208
  const message = safeErrorMessage(error);
986
1209
  ctx.logger.error(`fluidgrids ${label} failed`, { error: message });
@@ -1471,17 +1694,346 @@ function registerRunTools(server, ctx, track) {
1471
1694
  },
1472
1695
  async ({ id: runId, nodeId }) => runTool(ctx, "runs_retry_node", async () => {
1473
1696
  const runData = await ctx.gql.workspace.request(GET_RUN, { id: runId });
1474
- const state = runData.workflowRun?.nodeStates?.find((s) => s.nodeId === nodeId);
1475
- if (!state) {
1476
- return errorResult(`No node state found for run ${runId} node ${nodeId}`);
1697
+ const states = runData.workflowRun?.nodeStates?.filter(
1698
+ (s) => s.nodeId === nodeId && ["FAILED", "TIMEOUT"].includes(s.status)
1699
+ ) ?? [];
1700
+ const [state] = states;
1701
+ if (!state || states.length !== 1) {
1702
+ return errorResult(`Expected one failed node state for run ${runId} node ${nodeId}`);
1477
1703
  }
1478
1704
  const data = await ctx.gql.workspace.request(RETRY_RUN, {
1479
- id: state.id
1705
+ id: state.id,
1706
+ nodeId
1480
1707
  });
1481
1708
  return jsonResult(data.retryNode);
1482
1709
  })
1483
1710
  );
1484
1711
  }
1712
+ var text = zod.z.string().trim().min(1);
1713
+ var json = zod.z.unknown().refine((value) => value !== void 0 && value !== null, "JSON is required");
1714
+ var target = zod.z.object({ workflowKey: text, workflowId: text.max(256), firstRunId: text.optional() }).strict();
1715
+ var run = zod.z.union([text, target]).describe("A run ID or a workflowKey/workflowId target, optionally pinned by firstRunId");
1716
+ var read = { readOnlyHint: true, destructiveHint: false, openWorldHint: false };
1717
+ var write = { readOnlyHint: false, destructiveHint: false, openWorldHint: true };
1718
+ var destructive = { readOnlyHint: false, destructiveHint: true, openWorldHint: true };
1719
+ var duration = zod.z.union([zod.z.number().int().nonnegative(), text]).transform(String);
1720
+ var startShape = {
1721
+ workflowKey: text,
1722
+ version: text.optional(),
1723
+ workflowFn: text.optional(),
1724
+ input: zod.z.unknown().optional(),
1725
+ signals: zod.z.array(zod.z.object({ name: text, payload: zod.z.unknown().optional() }).strict()).max(100).optional(),
1726
+ idempotencyKey: text.optional(),
1727
+ workflowId: text.max(256).optional(),
1728
+ idReusePolicy: zod.z.enum(["ALLOW_DUPLICATE", "ALLOW_DUPLICATE_FAILED_ONLY", "REJECT_DUPLICATE"]).optional(),
1729
+ idConflictPolicy: zod.z.enum(["FAIL", "USE_EXISTING", "TERMINATE_EXISTING"]).optional(),
1730
+ summary: zod.z.string().max(200).optional(),
1731
+ details: zod.z.string().optional(),
1732
+ memo: zod.z.record(zod.z.string(), zod.z.unknown()).optional(),
1733
+ startDelay: duration.optional(),
1734
+ executionTimeout: duration.optional(),
1735
+ runTimeout: duration.optional(),
1736
+ workflowTaskTimeout: duration.optional(),
1737
+ priority: zod.z.number().int().min(1).max(5).optional(),
1738
+ completionCallback: zod.z.object({
1739
+ url: text.url().refine((url) => /^https?:/.test(url), "Use an HTTP(S) callback URL"),
1740
+ headers: zod.z.record(zod.z.string(), zod.z.string()).optional(),
1741
+ signingSecret: zod.z.string().min(16).max(512).optional()
1742
+ }).strict().optional(),
1743
+ versioningBehavior: zod.z.enum(["PINNED", "AUTO_UPGRADE"]).optional()
1744
+ };
1745
+ function registerDurableTools(server, ctx, track) {
1746
+ function tool(name, title, description, shape, annotations, handler) {
1747
+ registerTool(
1748
+ server,
1749
+ ctx,
1750
+ track(name),
1751
+ { title, description, inputSchema: shape, annotations },
1752
+ async (args) => runTool(ctx, name, () => handler(zod.z.object(shape).strict().parse(args)))
1753
+ );
1754
+ }
1755
+ async function request(document, variables, root) {
1756
+ const data = await ctx.gql.workspace.request(
1757
+ document,
1758
+ definedInput(variables)
1759
+ );
1760
+ return jsonResult(data[root] ?? null);
1761
+ }
1762
+ tool(
1763
+ mcpToolName(ctx.productName, "runs_by_workflow_id"),
1764
+ "Run by Workflow ID",
1765
+ "Read the latest visible run of a workflow ID. firstRunId pins its continue-as-new chain. Requires durable parity.",
1766
+ target.shape,
1767
+ read,
1768
+ (args) => request(RUN_BY_WORKFLOW_ID, args, "workflowRunByWorkflowId")
1769
+ );
1770
+ tool(
1771
+ mcpToolName(ctx.productName, "runs_describe"),
1772
+ "Describe Durable Run",
1773
+ "Read execution kind, durable state and determinism status. A workflow-ID target also returns chain metadata.",
1774
+ { run },
1775
+ read,
1776
+ ({ run: ref }) => typeof ref === "string" ? request(DESCRIBE_RUN, { id: ref }, "workflowRun") : request(RUN_BY_WORKFLOW_ID, ref, "workflowRunByWorkflowId")
1777
+ );
1778
+ tool(
1779
+ mcpToolName(ctx.productName, "runs_pending"),
1780
+ "Pending Run Work",
1781
+ "Read pending activities, children, timers, buffered signals and the open workflow task. Requires durable parity.",
1782
+ { run },
1783
+ read,
1784
+ async ({ run: ref }) => {
1785
+ const byId = typeof ref === "string";
1786
+ const data = await ctx.gql.workspace.request(byId ? RUN_PENDING : RUN_PENDING_BY_WORKFLOW_ID, byId ? { id: ref } : ref);
1787
+ const row = data[byId ? "workflowRun" : "workflowRunByWorkflowId"];
1788
+ return jsonResult(row ? { runId: row.id, status: row.status, pending: row.pending } : null);
1789
+ }
1790
+ );
1791
+ tool(
1792
+ mcpToolName(ctx.productName, "runs_count"),
1793
+ "Count Runs",
1794
+ "Count visible runs, optionally grouped by up to two columns. No pagination applies. Requires durable parity.",
1795
+ {
1796
+ filter: zod.z.object({
1797
+ status: zod.z.enum([
1798
+ "CANCELLED",
1799
+ "COMPLETED",
1800
+ "FAILED",
1801
+ "PENDING",
1802
+ "RUNNING",
1803
+ "TERMINATED",
1804
+ "WAITING"
1805
+ ]).optional(),
1806
+ workflowKey: text.optional(),
1807
+ nodeId: text.optional(),
1808
+ search: zod.z.string().optional(),
1809
+ startDate: text.optional(),
1810
+ endDate: text.optional(),
1811
+ errorType: text.optional(),
1812
+ durationMinSeconds: zod.z.number().nonnegative().optional(),
1813
+ durationMaxSeconds: zod.z.number().nonnegative().optional(),
1814
+ executionKind: zod.z.enum(["GRAPH", "DURABLE_FN"]).optional(),
1815
+ businessId: text.optional(),
1816
+ firstRunId: text.optional(),
1817
+ rootRunId: text.optional(),
1818
+ memo: zod.z.record(zod.z.string(), zod.z.unknown()).optional()
1819
+ }).strict().optional(),
1820
+ groupBy: zod.z.array(zod.z.enum(["STATUS", "WORKFLOW_KEY", "EXECUTION_KIND", "TASK_QUEUE"])).max(2).optional()
1821
+ },
1822
+ read,
1823
+ (args) => request(RUNS_COUNT, args, "workflowRunsCount")
1824
+ );
1825
+ tool(
1826
+ mcpToolName(ctx.productName, "runs_history"),
1827
+ "Run History Page",
1828
+ "Read one bounded history page. Pass nextAfter as after; offloaded payload URLs are returned, not fetched.",
1829
+ {
1830
+ run,
1831
+ after: zod.z.number().int().nonnegative().optional(),
1832
+ limit: zod.z.number().int().min(1).max(1e3).optional()
1833
+ },
1834
+ read,
1835
+ ({ run: ref, ...options }) => request(
1836
+ typeof ref === "string" ? RUN_HISTORY : RUN_HISTORY_BY_TARGET,
1837
+ { ...typeof ref === "string" ? { runId: ref } : { target: ref }, ...options },
1838
+ "workflowRunHistory"
1839
+ )
1840
+ );
1841
+ tool(
1842
+ mcpToolName(ctx.productName, "runs_signal"),
1843
+ "Signal Run",
1844
+ "Send a signal, potentially resuming a workflow and external actions. Use an idempotencyKey for safe retries. Gateway execute permission and feature gates apply.",
1845
+ { run, name: text, payload: zod.z.unknown().optional(), idempotencyKey: text.optional() },
1846
+ destructive,
1847
+ ({ run: ref, ...input }) => request(
1848
+ typeof ref === "string" ? SIGNAL_RUN : SIGNAL_RUN_BY_TARGET,
1849
+ { ...typeof ref === "string" ? { runId: ref } : { target: ref }, ...input },
1850
+ "signalWorkflowRun"
1851
+ )
1852
+ );
1853
+ tool(
1854
+ mcpToolName(ctx.productName, "runs_stack_trace"),
1855
+ "Run Stack Trace",
1856
+ "Read the current replayed stack trace. Enhanced traces and optional metadata describe current execution; metadata and workflow-ID targets require durable parity.",
1857
+ { run, enhanced: zod.z.boolean().optional(), metadata: zod.z.boolean().optional() },
1858
+ read,
1859
+ ({ run: ref, enhanced, metadata }) => request(
1860
+ typeof ref !== "string" || metadata ? RUN_STACK_TRACE_PARITY : RUN_STACK_TRACE,
1861
+ {
1862
+ ...typeof ref === "string" ? { runId: ref } : { target: ref },
1863
+ enhanced,
1864
+ ...metadata ? { metadata } : {}
1865
+ },
1866
+ "workflowRunStackTrace"
1867
+ )
1868
+ );
1869
+ tool(
1870
+ mcpToolName(ctx.productName, "runs_determinism"),
1871
+ "Run Determinism Status",
1872
+ "Read whether workflow tasks keep failing and why, without changing run state.",
1873
+ { runId: text },
1874
+ read,
1875
+ (args) => request(RUN_DETERMINISM_STATUS, args, "workflowRunDeterminismStatus")
1876
+ );
1877
+ tool(
1878
+ mcpToolName(ctx.productName, "runs_terminate"),
1879
+ "Terminate Run",
1880
+ "Immediately stop a run without cancellation handlers. This is destructive and requires gateway workflow-run delete permission.",
1881
+ { run, reason: zod.z.string().optional() },
1882
+ destructive,
1883
+ ({ run: ref, reason }) => request(
1884
+ typeof ref === "string" ? TERMINATE_RUN : TERMINATE_RUN_BY_TARGET,
1885
+ { ...typeof ref === "string" ? { runId: ref } : { target: ref }, reason },
1886
+ "terminateWorkflowRun"
1887
+ )
1888
+ );
1889
+ tool(
1890
+ mcpToolName(ctx.productName, "workflows_start"),
1891
+ "Start Durable Workflow",
1892
+ "Start a durable workflow, which may execute external actions. Confirm intent before calling. TERMINATE_EXISTING terminates the open run and uses the separate delete-permission gateway operation. Parity options require durable parity.",
1893
+ startShape,
1894
+ destructive,
1895
+ ({ memo, completionCallback, ...input }) => {
1896
+ const terminate = input.idConflictPolicy === "TERMINATE_EXISTING";
1897
+ if (terminate && !input.workflowId)
1898
+ throw new McpUserError("TERMINATE_EXISTING requires workflowId");
1899
+ const parity = Object.keys(input).some(
1900
+ (key) => ![
1901
+ "workflowKey",
1902
+ "version",
1903
+ "workflowFn",
1904
+ "input",
1905
+ "signals",
1906
+ "idempotencyKey"
1907
+ ].includes(key)
1908
+ ) || memo !== void 0 || completionCallback !== void 0;
1909
+ return request(
1910
+ terminate ? START_WORKFLOW_TERMINATE_EXISTING : parity ? START_WORKFLOW_PARITY : START_WORKFLOW,
1911
+ {
1912
+ input: definedInput({
1913
+ ...input,
1914
+ context: memo,
1915
+ completionCallbackUrl: completionCallback?.url,
1916
+ completionCallbackHeaders: completionCallback?.headers,
1917
+ completionCallbackSigningSecret: completionCallback?.signingSecret
1918
+ })
1919
+ },
1920
+ terminate ? "startWorkflowTerminateExisting" : "startWorkflow"
1921
+ );
1922
+ }
1923
+ );
1924
+ tool(
1925
+ mcpToolName(ctx.productName, "workflows_export"),
1926
+ "Export Workflow",
1927
+ "Read a portable workflow document or generated code with a fidelity report. Returned file URLs are not downloaded.",
1928
+ {
1929
+ workflowKey: text,
1930
+ version: text.optional(),
1931
+ format: zod.z.enum(["JSON", "TYPESCRIPT", "PYTHON", "YAML", "BUNDLE"]).optional(),
1932
+ options: zod.z.object({
1933
+ connectionNames: zod.z.boolean().optional(),
1934
+ connectionNameMap: zod.z.record(zod.z.string(), zod.z.string()).optional(),
1935
+ includeLayout: zod.z.boolean().optional(),
1936
+ includePinnedData: zod.z.boolean().optional()
1937
+ }).strict().optional()
1938
+ },
1939
+ read,
1940
+ (args) => request(EXPORT_WORKFLOW, args, "exportWorkflow")
1941
+ );
1942
+ tool(
1943
+ mcpToolName(ctx.productName, "workflows_interface"),
1944
+ "Workflow Interface",
1945
+ "Read the typed interface of a workflow version; null when none exists.",
1946
+ { workflowKey: text, version: text.optional() },
1947
+ read,
1948
+ (args) => request(WORKFLOW_INTERFACE, args, "workflowInterface")
1949
+ );
1950
+ tool(
1951
+ mcpToolName(ctx.productName, "workflows_validate"),
1952
+ "Validate Workflow",
1953
+ "Validate definition JSON without saving or executing it. strict adds code-authored IR rules.",
1954
+ { definitionJson: json, strict: zod.z.boolean().optional() },
1955
+ read,
1956
+ (args) => request(VALIDATE_WORKFLOW_DEFINITION, args, "validateWorkflowDefinition")
1957
+ );
1958
+ tool(
1959
+ mcpToolName(ctx.productName, "workflows_create_version"),
1960
+ "Create Workflow Version",
1961
+ "Add a workflow version without running it. Preserve baseVersion/expectedRevision/editSessionId for optimistic concurrency.",
1962
+ {
1963
+ workflowKey: text,
1964
+ definitionJson: json,
1965
+ version: text.optional(),
1966
+ description: zod.z.string().optional(),
1967
+ alias: text.optional(),
1968
+ baseVersion: text.optional(),
1969
+ expectedRevision: zod.z.number().int().nonnegative().optional(),
1970
+ editSessionId: text.optional(),
1971
+ interface: zod.z.unknown().optional(),
1972
+ authoring: zod.z.unknown().optional()
1973
+ },
1974
+ write,
1975
+ ({ workflowKey, ...input }) => request(
1976
+ CREATE_WORKFLOW_VERSION,
1977
+ { workflowKey, input: definedInput(input) },
1978
+ "createWorkflowVersion"
1979
+ )
1980
+ );
1981
+ tool(
1982
+ mcpToolName(ctx.productName, "workflows_import"),
1983
+ "Import Workflow",
1984
+ "Create a DRAFT from exactly one of definitionJson or inline source files. The service validates/builds source; no workflow is started. Never put literal credentials in imported source.",
1985
+ {
1986
+ name: text,
1987
+ definitionJson: json.optional(),
1988
+ source: zod.z.object({
1989
+ format: zod.z.enum(["JSON", "TYPESCRIPT"]),
1990
+ files: zod.z.array(zod.z.object({ path: text, content: zod.z.string() }).strict()).min(1),
1991
+ connections: zod.z.record(zod.z.string(), zod.z.object({ connectionId: text, adapter: text.optional() }).strict()).optional()
1992
+ }).strict().optional(),
1993
+ workflowKey: text.optional(),
1994
+ version: text.optional(),
1995
+ description: zod.z.string().optional(),
1996
+ alias: text.optional(),
1997
+ context: zod.z.unknown().optional(),
1998
+ tags: zod.z.array(zod.z.string()).optional(),
1999
+ tagsV2: zod.z.unknown().optional(),
2000
+ icon: zod.z.string().optional(),
2001
+ category: zod.z.string().optional(),
2002
+ nodeMappings: zod.z.unknown().optional(),
2003
+ allowMissingNodes: zod.z.boolean().optional()
2004
+ },
2005
+ write,
2006
+ (input) => {
2007
+ if (input.definitionJson === void 0 === (input.source === void 0))
2008
+ throw new McpUserError("Import requires exactly one of definitionJson or source");
2009
+ return request(IMPORT_WORKFLOW, { input: definedInput(input) }, "importWorkflow");
2010
+ }
2011
+ );
2012
+ tool(
2013
+ mcpToolName(ctx.productName, "workflows_import_template"),
2014
+ "Import Workflow Template",
2015
+ "Import a store template as a DRAFT workflow. This does not purchase a template, activate it or run it.",
2016
+ {
2017
+ name: text,
2018
+ definitionJson: json,
2019
+ sourceTemplateId: text,
2020
+ sourceTemplateName: zod.z.string().optional(),
2021
+ workflowKey: text.optional(),
2022
+ description: zod.z.string().optional(),
2023
+ category: zod.z.string().optional(),
2024
+ icon: zod.z.string().optional(),
2025
+ tags: zod.z.array(zod.z.string()).optional(),
2026
+ projectId: text.optional(),
2027
+ context: zod.z.unknown().optional()
2028
+ },
2029
+ write,
2030
+ (input) => request(
2031
+ IMPORT_WORKFLOW_TEMPLATE,
2032
+ { input: definedInput(input) },
2033
+ "importWorkflowTemplate"
2034
+ )
2035
+ );
2036
+ }
1485
2037
  function registerScheduledJobTools(server, ctx, track) {
1486
2038
  server.registerTool(
1487
2039
  track(mcpToolName(ctx.productName, "scheduled_jobs_list")),
@@ -1560,7 +2112,7 @@ function registerScheduledJobTools(server, ctx, track) {
1560
2112
  async ({ jobId, ...input }) => runTool(ctx, "scheduled_jobs_update", async () => {
1561
2113
  const data = await ctx.gql.workspace.request(
1562
2114
  UPDATE_SCHEDULED_JOB,
1563
- { id: jobId, input: definedInput(input) }
2115
+ { jobId, input: definedInput(input) }
1564
2116
  );
1565
2117
  return jsonResult(data.updateWorkflowScheduledJob);
1566
2118
  })
@@ -2175,6 +2727,7 @@ var fluidgridsModule = {
2175
2727
  };
2176
2728
  registerWorkflowTools(server, ctx, trackTool);
2177
2729
  registerRunTools(server, ctx, trackTool);
2730
+ registerDurableTools(server, ctx, trackTool);
2178
2731
  registerNodeTools(server, ctx, trackTool);
2179
2732
  registerCredentialTools(server, ctx, trackTool);
2180
2733
  registerWebhookTools(server, ctx, trackTool);