@transcend-io/mcp-server-workflows 0.3.4 → 0.4.0

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/README.md CHANGED
@@ -6,7 +6,7 @@ Transcend MCP Server for workflow configuration. Provides tools for listing work
6
6
 
7
7
  Requires **Node.js ≥ 22.12** (see `engines` in `package.json`).
8
8
 
9
- For local runs from this repository, copy [`secret.env.example`](../../../secret.env.example) to **`secret.env`** at the repo root (gitignored) and set your API key (see **Run from the monorepo**). The key must be created with **MCP** enabled in the Transcend dashboard (a toggle when you create the key).
9
+ For local runs from this repository, copy [`secret.env.example`](../../../secret.env.example) to **`secret.env`** at the repo root (gitignored) and set the OAuth environment variables (see **Run from the monorepo**).
10
10
 
11
11
  ## Install
12
12
 
@@ -21,12 +21,31 @@ Or run from a checkout of this repository (see **Run from the monorepo** below).
21
21
  ## Usage
22
22
 
23
23
  ```bash
24
- # With TRANSCEND_API_KEY in the environment; from the monorepo use secret.env (see Run from the monorepo)
25
- TRANSCEND_API_KEY=your-api-key transcend-mcp-workflows
24
+ # With OAuth env vars in the environment; from the monorepo use secret.env (see Run from the monorepo)
25
+ TRANSCEND_OAUTH_CLIENT_ID=your-client-id \
26
+ TRANSCEND_OAUTH_CLIENT_SECRET=your-client-secret \
27
+ TRANSCEND_OAUTH_REDIRECT_PORT=your-client-redirect-port \
28
+ transcend-mcp-workflows
26
29
  ```
27
30
 
28
31
  The process speaks MCP over **stdio** and is meant to be launched by an MCP client (for example Cursor or Claude Desktop), not used as an interactive shell.
29
32
 
33
+ ### OAuth client setup
34
+
35
+ OAuth stdio is the recommended path for MCP clients (Cursor, Claude Desktop). Requires **org admin** access to create OAuth clients.
36
+
37
+ 1. Navigate to [app.transcend.com/admin/oauth-clients](https://app.transcend.com/admin/oauth-clients) and create an OAuth client.
38
+ 2. Copy the **client ID** and **client secret**.
39
+ 3. Register `http://127.0.0.1:{port}/callback` — use **`127.0.0.1`, not `localhost`**, and ensure the path is `/callback`. Set `TRANSCEND_OAUTH_REDIRECT_PORT` to the matching port.
40
+
41
+ At startup the server verifies client ID, secret, and redirect URI. On first tool call it opens a browser for login. Tokens are session-only (in-memory).
42
+
43
+ **OAuth scopes:** `ViewAllActionItems`, `ManageAllActionItems`, `ViewEmailTemplates`. The signed-in user must hold these permissions. See [`src/scopes.ts`](./src/scopes.ts).
44
+
45
+ Full setup, troubleshooting, and multi-server guidance: [MCP root README](../README.md#oauth-client-setup).
46
+
47
+ > **API key alternative:** set `TRANSCEND_API_KEY` instead of OAuth vars for stdio (OAuth is disabled when both are set).
48
+
30
49
  ### MCP client configuration
31
50
 
32
51
  `npx` runs the package’s `transcend-mcp-workflows` binary (see `bin` in `package.json`).
@@ -38,7 +57,9 @@ The process speaks MCP over **stdio** and is meant to be launched by an MCP clie
38
57
  "command": "npx",
39
58
  "args": ["-y", "@transcend-io/mcp-server-workflows"],
40
59
  "env": {
41
- "TRANSCEND_API_KEY": "your-api-key"
60
+ "TRANSCEND_OAUTH_CLIENT_ID": "your-client-id",
61
+ "TRANSCEND_OAUTH_CLIENT_SECRET": "your-client-secret",
62
+ "TRANSCEND_OAUTH_REDIRECT_PORT": "your-client-redirect-port"
42
63
  }
43
64
  }
44
65
  }
@@ -49,7 +70,7 @@ When developing in this repository, reuse the same variable names from root **`s
49
70
 
50
71
  ### Run from the monorepo
51
72
 
52
- 1. **Credentials** — From the repository root, copy [`secret.env.example`](../../../secret.env.example) to **`secret.env`** and set `TRANSCEND_API_KEY` (and optional URL overrides).
73
+ 1. **Credentials** — From the repository root, copy [`secret.env.example`](../../../secret.env.example) to **`secret.env`** and set `TRANSCEND_OAUTH_CLIENT_ID`, `TRANSCEND_OAUTH_CLIENT_SECRET`, and `TRANSCEND_OAUTH_REDIRECT_PORT` (and optional URL overrides).
53
74
 
54
75
  2. **Build and run** — `node ./dist/cli.mjs` matches the `transcend-mcp-workflows` `bin` (use `node` because `pnpm exec transcend-mcp-workflows` may not resolve this package’s own binary in a pnpm workspace):
55
76
 
@@ -66,11 +87,16 @@ See [CONTRIBUTING.md](../../../CONTRIBUTING.md#mcp-servers) for workspace layout
66
87
 
67
88
  ### Environment variables
68
89
 
69
- | Variable | Required | Default | Description |
70
- | ------------------- | -------- | ------------------------------------------ | -------------------------------------------------- |
71
- | `TRANSCEND_API_KEY` | Yes | — | Transcend API key |
72
- | `TRANSCEND_API_URL` | No | `https://api.transcend.io` | GraphQL backend API URL (matches CLI convention) |
73
- | `SOMBRA_URL` | No | `https://multi-tenant.sombra.transcend.io` | Sombra REST API URL (matches CLI / SDK convention) |
90
+ | Variable | Required (stdio OAuth) | Default | Description |
91
+ | ------------------------------- | ---------------------- | ------------------------------------------ | ----------------------------------------------------------------------------------------------------- |
92
+ | `TRANSCEND_OAUTH_CLIENT_ID` | Yes | — | Client ID from [app.transcend.com/admin/oauth-clients](https://app.transcend.com/admin/oauth-clients) |
93
+ | `TRANSCEND_OAUTH_CLIENT_SECRET` | Yes | | Client secret from the same OAuth clients page |
94
+ | `TRANSCEND_OAUTH_REDIRECT_PORT` | Yes | | Localhost port for the OAuth callback server; **must match the port in your registered redirect URI** |
95
+ | `TRANSCEND_OAUTH_REDIRECT_HOST` | No | `127.0.0.1` | Loopback host for the OAuth callback (`127.0.0.1` or `::1` for `http://[::1]:{port}/callback`) |
96
+ | `TRANSCEND_OAUTH_ISSUER` | No | auto-detected | OAuth issuer URL; production auto-detects region. Test-only override |
97
+ | `TRANSCEND_API_KEY` | No | — | API key for stdio (alternative to OAuth). Disables OAuth when set alongside client ID |
98
+ | `TRANSCEND_API_URL` | No | `https://api.transcend.io` | GraphQL backend API URL (matches CLI convention) |
99
+ | `SOMBRA_URL` | No | `https://multi-tenant.sombra.transcend.io` | Sombra REST API URL (matches CLI / SDK convention) |
74
100
 
75
101
  **Monorepo:** keep these in root **`secret.env`** (from [`secret.env.example`](../../../secret.env.example)); see **Run from the monorepo**.
76
102
 
package/dist/cli.mjs CHANGED
@@ -1,14 +1,16 @@
1
1
  #!/usr/bin/env node
2
- import { n as getWorkflowTools, t as WorkflowsMixin } from "./graphql-oANS0b0T.mjs";
2
+ import { n as WORKFLOW_OAUTH_SCOPES, r as getWorkflowTools, t as WorkflowsMixin } from "./graphql-BLrX1gBY.mjs";
3
3
  import { TranscendRestClient, createMCPServer } from "@transcend-io/mcp-server-base";
4
4
  //#region src/cli.ts
5
5
  createMCPServer({
6
6
  name: "transcend-mcp-workflows",
7
7
  version: "1.0.0",
8
+ oauthScopes: WORKFLOW_OAUTH_SCOPES,
8
9
  getTools: getWorkflowTools,
9
- createClients: (auth, sombraUrl, graphqlUrl) => ({
10
+ createClients: ({ auth, sombraUrl, graphqlUrl, dashboardUrl }) => ({
10
11
  rest: new TranscendRestClient(auth, sombraUrl),
11
- graphql: new WorkflowsMixin(auth, graphqlUrl)
12
+ graphql: new WorkflowsMixin(auth, graphqlUrl),
13
+ dashboardUrl
12
14
  })
13
15
  });
14
16
  //#endregion
package/dist/cli.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.mjs","names":[],"sources":["../src/cli.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { createMCPServer, TranscendRestClient } from '@transcend-io/mcp-server-base';\n\nimport { WorkflowsMixin } from './graphql.js';\nimport { getWorkflowTools } from './tools/index.js';\n\ncreateMCPServer({\n name: 'transcend-mcp-workflows',\n version: '1.0.0',\n getTools: getWorkflowTools,\n createClients: (auth, sombraUrl, graphqlUrl) => ({\n rest: new TranscendRestClient(auth, sombraUrl),\n graphql: new WorkflowsMixin(auth, graphqlUrl),\n }),\n});\n"],"mappings":";;;;AAMA,gBAAgB;CACd,MAAM;CACN,SAAS;CACT,UAAU;CACV,gBAAgB,MAAM,WAAW,gBAAgB;EAC/C,MAAM,IAAI,oBAAoB,MAAM,UAAU;EAC9C,SAAS,IAAI,eAAe,MAAM,WAAW;EAC9C;CACF,CAAC"}
1
+ {"version":3,"file":"cli.mjs","names":[],"sources":["../src/cli.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { createMCPServer, TranscendRestClient } from '@transcend-io/mcp-server-base';\n\nimport { WorkflowsMixin } from './graphql.js';\nimport { WORKFLOW_OAUTH_SCOPES } from './scopes.js';\nimport { getWorkflowTools } from './tools/index.js';\n\ncreateMCPServer({\n name: 'transcend-mcp-workflows',\n version: '1.0.0',\n oauthScopes: WORKFLOW_OAUTH_SCOPES,\n getTools: getWorkflowTools,\n createClients: ({ auth, sombraUrl, graphqlUrl, dashboardUrl }) => ({\n rest: new TranscendRestClient(auth, sombraUrl),\n graphql: new WorkflowsMixin(auth, graphqlUrl),\n dashboardUrl,\n }),\n});\n"],"mappings":";;;;AAOA,gBAAgB;CACd,MAAM;CACN,SAAS;CACT,aAAa;CACb,UAAU;CACV,gBAAgB,EAAE,MAAM,WAAW,YAAY,oBAAoB;EACjE,MAAM,IAAI,oBAAoB,MAAM,UAAU;EAC9C,SAAS,IAAI,eAAe,MAAM,WAAW;EAC7C;EACD;CACF,CAAC"}
@@ -0,0 +1,645 @@
1
+ import { PaginationSchema, TranscendGraphQLBase, createListResult, createToolResult, defineTool, z } from "@transcend-io/mcp-server-base";
2
+ import { ScopeName } from "@transcend-io/privacy-types";
3
+ //#region src/tools/workflows_list.ts
4
+ const ListWorkflowsSchema = PaginationSchema.extend({ cursor: z.string().optional().describe("Pagination cursor from previous response (where supported)") });
5
+ function createWorkflowsListTool(clients) {
6
+ const graphql = clients.graphql;
7
+ return defineTool({
8
+ name: "workflows_list",
9
+ description: "List all workflows configured in your organization. Note: API does not support cursor pagination (max ~100 results).",
10
+ category: "Workflows",
11
+ readOnly: true,
12
+ annotations: {
13
+ readOnlyHint: true,
14
+ destructiveHint: false,
15
+ idempotentHint: true
16
+ },
17
+ zodSchema: ListWorkflowsSchema,
18
+ handler: async ({ limit, cursor }) => {
19
+ const result = await graphql.listWorkflows({
20
+ first: limit,
21
+ after: cursor
22
+ });
23
+ return createListResult(result.nodes, {
24
+ totalCount: result.totalCount,
25
+ hasNextPage: result.pageInfo?.hasNextPage
26
+ });
27
+ }
28
+ });
29
+ }
30
+ //#endregion
31
+ //#region src/tools/workflows_list_email_templates.ts
32
+ const ListEmailTemplatesSchema = PaginationSchema.extend({
33
+ cursor: z.string().optional().describe("Pagination cursor from previous response (where supported)"),
34
+ offset: z.coerce.number().min(0).optional().default(0).describe("Number of results to skip (default: 0)")
35
+ });
36
+ function createWorkflowsListEmailTemplatesTool(clients) {
37
+ const graphql = clients.graphql;
38
+ return defineTool({
39
+ name: "workflows_list_email_templates",
40
+ description: "List all email templates used in workflows and communications. Note: API does not support cursor pagination (max ~100 results).",
41
+ category: "Workflows",
42
+ readOnly: true,
43
+ annotations: {
44
+ readOnlyHint: true,
45
+ destructiveHint: false,
46
+ idempotentHint: true
47
+ },
48
+ zodSchema: ListEmailTemplatesSchema,
49
+ handler: async ({ limit, offset }) => {
50
+ const result = await graphql.listEmailTemplates({
51
+ first: limit,
52
+ offset
53
+ });
54
+ return createListResult(result.nodes, {
55
+ totalCount: result.totalCount,
56
+ hasNextPage: result.pageInfo?.hasNextPage
57
+ });
58
+ }
59
+ });
60
+ }
61
+ //#endregion
62
+ //#region src/tools/workflows_update_config.ts
63
+ const UpdateWorkflowConfigSchema = z.object({
64
+ workflowConfigId: z.string().describe("ID of the workflow config to update (use workflows_list to find config IDs)"),
65
+ title: z.string().optional().describe("New title for the workflow"),
66
+ subtitle: z.string().optional().describe("New subtitle for the workflow"),
67
+ description: z.string().optional().describe("New description for the workflow")
68
+ });
69
+ function createWorkflowsUpdateConfigTool(clients) {
70
+ const graphql = clients.graphql;
71
+ return defineTool({
72
+ name: "workflows_update_config",
73
+ description: "Update the configuration for a workflow. Supported fields: title, subtitle, description. Note: privacy-center visibility is controlled by the workflow config's visibility tier and is not editable through this tool.",
74
+ category: "Workflows",
75
+ readOnly: false,
76
+ confirmationHint: "Updates the workflow configuration",
77
+ annotations: {
78
+ readOnlyHint: false,
79
+ destructiveHint: false,
80
+ idempotentHint: true
81
+ },
82
+ zodSchema: UpdateWorkflowConfigSchema,
83
+ handler: async ({ workflowConfigId, title, subtitle, description }) => {
84
+ const updates = {};
85
+ if (title !== void 0) updates.title = title;
86
+ if (subtitle !== void 0) updates.subtitle = subtitle;
87
+ if (description !== void 0) updates.description = description;
88
+ return createToolResult(true, {
89
+ workflowConfig: await graphql.updateWorkflowConfig(workflowConfigId, updates),
90
+ message: "Workflow configuration updated successfully"
91
+ });
92
+ }
93
+ });
94
+ }
95
+ //#endregion
96
+ //#region src/tools/index.ts
97
+ function getWorkflowTools(clients) {
98
+ return [
99
+ createWorkflowsListTool(clients),
100
+ createWorkflowsUpdateConfigTool(clients),
101
+ createWorkflowsListEmailTemplatesTool(clients)
102
+ ];
103
+ }
104
+ //#endregion
105
+ //#region src/scopes.ts
106
+ /** OAuth scopes required for Workflow MCP tools (offline_access added by base). */
107
+ const WORKFLOW_OAUTH_SCOPES = [
108
+ ScopeName.ViewAllActionItems,
109
+ ScopeName.ManageAllActionItems,
110
+ ScopeName.ViewEmailTemplates
111
+ ];
112
+ //#endregion
113
+ //#region src/__generated__/gql.ts
114
+ const documents = {
115
+ "\n query WorkflowsList($first: Int) {\n workflows(first: $first) {\n nodes {\n id\n title {\n defaultMessage\n }\n }\n totalCount\n }\n }\n": {
116
+ "kind": "Document",
117
+ "definitions": [{
118
+ "kind": "OperationDefinition",
119
+ "operation": "query",
120
+ "name": {
121
+ "kind": "Name",
122
+ "value": "WorkflowsList"
123
+ },
124
+ "variableDefinitions": [{
125
+ "kind": "VariableDefinition",
126
+ "variable": {
127
+ "kind": "Variable",
128
+ "name": {
129
+ "kind": "Name",
130
+ "value": "first"
131
+ }
132
+ },
133
+ "type": {
134
+ "kind": "NamedType",
135
+ "name": {
136
+ "kind": "Name",
137
+ "value": "Int"
138
+ }
139
+ }
140
+ }],
141
+ "selectionSet": {
142
+ "kind": "SelectionSet",
143
+ "selections": [{
144
+ "kind": "Field",
145
+ "name": {
146
+ "kind": "Name",
147
+ "value": "workflows"
148
+ },
149
+ "arguments": [{
150
+ "kind": "Argument",
151
+ "name": {
152
+ "kind": "Name",
153
+ "value": "first"
154
+ },
155
+ "value": {
156
+ "kind": "Variable",
157
+ "name": {
158
+ "kind": "Name",
159
+ "value": "first"
160
+ }
161
+ }
162
+ }],
163
+ "selectionSet": {
164
+ "kind": "SelectionSet",
165
+ "selections": [{
166
+ "kind": "Field",
167
+ "name": {
168
+ "kind": "Name",
169
+ "value": "nodes"
170
+ },
171
+ "selectionSet": {
172
+ "kind": "SelectionSet",
173
+ "selections": [{
174
+ "kind": "Field",
175
+ "name": {
176
+ "kind": "Name",
177
+ "value": "id"
178
+ }
179
+ }, {
180
+ "kind": "Field",
181
+ "name": {
182
+ "kind": "Name",
183
+ "value": "title"
184
+ },
185
+ "selectionSet": {
186
+ "kind": "SelectionSet",
187
+ "selections": [{
188
+ "kind": "Field",
189
+ "name": {
190
+ "kind": "Name",
191
+ "value": "defaultMessage"
192
+ }
193
+ }]
194
+ }
195
+ }]
196
+ }
197
+ }, {
198
+ "kind": "Field",
199
+ "name": {
200
+ "kind": "Name",
201
+ "value": "totalCount"
202
+ }
203
+ }]
204
+ }
205
+ }]
206
+ }
207
+ }]
208
+ },
209
+ "\n mutation WorkflowsUpdateConfig($input: UpdateWorkflowConfigInput!) {\n updateWorkflowConfig(input: $input) {\n success\n }\n }\n": {
210
+ "kind": "Document",
211
+ "definitions": [{
212
+ "kind": "OperationDefinition",
213
+ "operation": "mutation",
214
+ "name": {
215
+ "kind": "Name",
216
+ "value": "WorkflowsUpdateConfig"
217
+ },
218
+ "variableDefinitions": [{
219
+ "kind": "VariableDefinition",
220
+ "variable": {
221
+ "kind": "Variable",
222
+ "name": {
223
+ "kind": "Name",
224
+ "value": "input"
225
+ }
226
+ },
227
+ "type": {
228
+ "kind": "NonNullType",
229
+ "type": {
230
+ "kind": "NamedType",
231
+ "name": {
232
+ "kind": "Name",
233
+ "value": "UpdateWorkflowConfigInput"
234
+ }
235
+ }
236
+ }
237
+ }],
238
+ "selectionSet": {
239
+ "kind": "SelectionSet",
240
+ "selections": [{
241
+ "kind": "Field",
242
+ "name": {
243
+ "kind": "Name",
244
+ "value": "updateWorkflowConfig"
245
+ },
246
+ "arguments": [{
247
+ "kind": "Argument",
248
+ "name": {
249
+ "kind": "Name",
250
+ "value": "input"
251
+ },
252
+ "value": {
253
+ "kind": "Variable",
254
+ "name": {
255
+ "kind": "Name",
256
+ "value": "input"
257
+ }
258
+ }
259
+ }],
260
+ "selectionSet": {
261
+ "kind": "SelectionSet",
262
+ "selections": [{
263
+ "kind": "Field",
264
+ "name": {
265
+ "kind": "Name",
266
+ "value": "success"
267
+ }
268
+ }]
269
+ }
270
+ }]
271
+ }
272
+ }]
273
+ },
274
+ "\n query WorkflowsReadConfig($input: WorkflowConfigInput!) {\n workflowConfig(input: $input) {\n workflowConfig {\n id\n title {\n defaultMessage\n }\n subtitle {\n defaultMessage\n }\n description {\n defaultMessage\n }\n }\n }\n }\n": {
275
+ "kind": "Document",
276
+ "definitions": [{
277
+ "kind": "OperationDefinition",
278
+ "operation": "query",
279
+ "name": {
280
+ "kind": "Name",
281
+ "value": "WorkflowsReadConfig"
282
+ },
283
+ "variableDefinitions": [{
284
+ "kind": "VariableDefinition",
285
+ "variable": {
286
+ "kind": "Variable",
287
+ "name": {
288
+ "kind": "Name",
289
+ "value": "input"
290
+ }
291
+ },
292
+ "type": {
293
+ "kind": "NonNullType",
294
+ "type": {
295
+ "kind": "NamedType",
296
+ "name": {
297
+ "kind": "Name",
298
+ "value": "WorkflowConfigInput"
299
+ }
300
+ }
301
+ }
302
+ }],
303
+ "selectionSet": {
304
+ "kind": "SelectionSet",
305
+ "selections": [{
306
+ "kind": "Field",
307
+ "name": {
308
+ "kind": "Name",
309
+ "value": "workflowConfig"
310
+ },
311
+ "arguments": [{
312
+ "kind": "Argument",
313
+ "name": {
314
+ "kind": "Name",
315
+ "value": "input"
316
+ },
317
+ "value": {
318
+ "kind": "Variable",
319
+ "name": {
320
+ "kind": "Name",
321
+ "value": "input"
322
+ }
323
+ }
324
+ }],
325
+ "selectionSet": {
326
+ "kind": "SelectionSet",
327
+ "selections": [{
328
+ "kind": "Field",
329
+ "name": {
330
+ "kind": "Name",
331
+ "value": "workflowConfig"
332
+ },
333
+ "selectionSet": {
334
+ "kind": "SelectionSet",
335
+ "selections": [
336
+ {
337
+ "kind": "Field",
338
+ "name": {
339
+ "kind": "Name",
340
+ "value": "id"
341
+ }
342
+ },
343
+ {
344
+ "kind": "Field",
345
+ "name": {
346
+ "kind": "Name",
347
+ "value": "title"
348
+ },
349
+ "selectionSet": {
350
+ "kind": "SelectionSet",
351
+ "selections": [{
352
+ "kind": "Field",
353
+ "name": {
354
+ "kind": "Name",
355
+ "value": "defaultMessage"
356
+ }
357
+ }]
358
+ }
359
+ },
360
+ {
361
+ "kind": "Field",
362
+ "name": {
363
+ "kind": "Name",
364
+ "value": "subtitle"
365
+ },
366
+ "selectionSet": {
367
+ "kind": "SelectionSet",
368
+ "selections": [{
369
+ "kind": "Field",
370
+ "name": {
371
+ "kind": "Name",
372
+ "value": "defaultMessage"
373
+ }
374
+ }]
375
+ }
376
+ },
377
+ {
378
+ "kind": "Field",
379
+ "name": {
380
+ "kind": "Name",
381
+ "value": "description"
382
+ },
383
+ "selectionSet": {
384
+ "kind": "SelectionSet",
385
+ "selections": [{
386
+ "kind": "Field",
387
+ "name": {
388
+ "kind": "Name",
389
+ "value": "defaultMessage"
390
+ }
391
+ }]
392
+ }
393
+ }
394
+ ]
395
+ }
396
+ }]
397
+ }
398
+ }]
399
+ }
400
+ }]
401
+ },
402
+ "\n query WorkflowsListTemplates($first: Int, $offset: Int) {\n templates(first: $first, offset: $offset) {\n nodes {\n id\n title\n type\n isRequired\n }\n totalCount\n }\n }\n": {
403
+ "kind": "Document",
404
+ "definitions": [{
405
+ "kind": "OperationDefinition",
406
+ "operation": "query",
407
+ "name": {
408
+ "kind": "Name",
409
+ "value": "WorkflowsListTemplates"
410
+ },
411
+ "variableDefinitions": [{
412
+ "kind": "VariableDefinition",
413
+ "variable": {
414
+ "kind": "Variable",
415
+ "name": {
416
+ "kind": "Name",
417
+ "value": "first"
418
+ }
419
+ },
420
+ "type": {
421
+ "kind": "NamedType",
422
+ "name": {
423
+ "kind": "Name",
424
+ "value": "Int"
425
+ }
426
+ }
427
+ }, {
428
+ "kind": "VariableDefinition",
429
+ "variable": {
430
+ "kind": "Variable",
431
+ "name": {
432
+ "kind": "Name",
433
+ "value": "offset"
434
+ }
435
+ },
436
+ "type": {
437
+ "kind": "NamedType",
438
+ "name": {
439
+ "kind": "Name",
440
+ "value": "Int"
441
+ }
442
+ }
443
+ }],
444
+ "selectionSet": {
445
+ "kind": "SelectionSet",
446
+ "selections": [{
447
+ "kind": "Field",
448
+ "name": {
449
+ "kind": "Name",
450
+ "value": "templates"
451
+ },
452
+ "arguments": [{
453
+ "kind": "Argument",
454
+ "name": {
455
+ "kind": "Name",
456
+ "value": "first"
457
+ },
458
+ "value": {
459
+ "kind": "Variable",
460
+ "name": {
461
+ "kind": "Name",
462
+ "value": "first"
463
+ }
464
+ }
465
+ }, {
466
+ "kind": "Argument",
467
+ "name": {
468
+ "kind": "Name",
469
+ "value": "offset"
470
+ },
471
+ "value": {
472
+ "kind": "Variable",
473
+ "name": {
474
+ "kind": "Name",
475
+ "value": "offset"
476
+ }
477
+ }
478
+ }],
479
+ "selectionSet": {
480
+ "kind": "SelectionSet",
481
+ "selections": [{
482
+ "kind": "Field",
483
+ "name": {
484
+ "kind": "Name",
485
+ "value": "nodes"
486
+ },
487
+ "selectionSet": {
488
+ "kind": "SelectionSet",
489
+ "selections": [
490
+ {
491
+ "kind": "Field",
492
+ "name": {
493
+ "kind": "Name",
494
+ "value": "id"
495
+ }
496
+ },
497
+ {
498
+ "kind": "Field",
499
+ "name": {
500
+ "kind": "Name",
501
+ "value": "title"
502
+ }
503
+ },
504
+ {
505
+ "kind": "Field",
506
+ "name": {
507
+ "kind": "Name",
508
+ "value": "type"
509
+ }
510
+ },
511
+ {
512
+ "kind": "Field",
513
+ "name": {
514
+ "kind": "Name",
515
+ "value": "isRequired"
516
+ }
517
+ }
518
+ ]
519
+ }
520
+ }, {
521
+ "kind": "Field",
522
+ "name": {
523
+ "kind": "Name",
524
+ "value": "totalCount"
525
+ }
526
+ }]
527
+ }
528
+ }]
529
+ }
530
+ }]
531
+ }
532
+ };
533
+ function graphql(source) {
534
+ return documents[source] ?? {};
535
+ }
536
+ //#endregion
537
+ //#region src/graphql.ts
538
+ const ListWorkflowsDoc = graphql(`
539
+ query WorkflowsList($first: Int) {
540
+ workflows(first: $first) {
541
+ nodes {
542
+ id
543
+ title {
544
+ defaultMessage
545
+ }
546
+ }
547
+ totalCount
548
+ }
549
+ }
550
+ `);
551
+ const UpdateWorkflowConfigDoc = graphql(`
552
+ mutation WorkflowsUpdateConfig($input: UpdateWorkflowConfigInput!) {
553
+ updateWorkflowConfig(input: $input) {
554
+ success
555
+ }
556
+ }
557
+ `);
558
+ const ReadWorkflowConfigDoc = graphql(`
559
+ query WorkflowsReadConfig($input: WorkflowConfigInput!) {
560
+ workflowConfig(input: $input) {
561
+ workflowConfig {
562
+ id
563
+ title {
564
+ defaultMessage
565
+ }
566
+ subtitle {
567
+ defaultMessage
568
+ }
569
+ description {
570
+ defaultMessage
571
+ }
572
+ }
573
+ }
574
+ }
575
+ `);
576
+ const ListEmailTemplatesDoc = graphql(`
577
+ query WorkflowsListTemplates($first: Int, $offset: Int) {
578
+ templates(first: $first, offset: $offset) {
579
+ nodes {
580
+ id
581
+ title
582
+ type
583
+ isRequired
584
+ }
585
+ totalCount
586
+ }
587
+ }
588
+ `);
589
+ var WorkflowsMixin = class extends TranscendGraphQLBase {
590
+ async listWorkflows(options) {
591
+ const data = await this.makeRequest(ListWorkflowsDoc, { first: Math.min(options?.first ?? 50, 100) });
592
+ return {
593
+ nodes: data.workflows.nodes.map((w) => ({
594
+ id: w.id,
595
+ title: { defaultMessage: w.title.defaultMessage }
596
+ })),
597
+ pageInfo: {
598
+ hasNextPage: data.workflows.nodes.length < data.workflows.totalCount,
599
+ hasPreviousPage: false
600
+ },
601
+ totalCount: data.workflows.totalCount
602
+ };
603
+ }
604
+ async updateWorkflowConfig(workflowConfigId, updates) {
605
+ await this.makeRequest(UpdateWorkflowConfigDoc, { input: {
606
+ workflowConfigId,
607
+ ...updates
608
+ } });
609
+ const wc = (await this.makeRequest(ReadWorkflowConfigDoc, { input: { id: workflowConfigId } })).workflowConfig.workflowConfig;
610
+ return {
611
+ id: wc.id,
612
+ title: wc.title.defaultMessage,
613
+ subtitle: wc.subtitle?.defaultMessage ?? "",
614
+ description: wc.description?.defaultMessage ?? ""
615
+ };
616
+ }
617
+ async listEmailTemplates(options) {
618
+ const data = await this.makeRequest(ListEmailTemplatesDoc, {
619
+ first: Math.min(options?.first ?? 50, 100),
620
+ offset: options?.offset ?? 0
621
+ });
622
+ const templates = data.templates.nodes.map((t) => ({
623
+ id: t.id,
624
+ name: t.title,
625
+ subject: "",
626
+ type: t.type,
627
+ locale: "",
628
+ isActive: t.isRequired,
629
+ createdAt: "",
630
+ updatedAt: ""
631
+ }));
632
+ return {
633
+ nodes: templates,
634
+ pageInfo: {
635
+ hasNextPage: templates.length < data.templates.totalCount,
636
+ hasPreviousPage: false
637
+ },
638
+ totalCount: data.templates.totalCount
639
+ };
640
+ }
641
+ };
642
+ //#endregion
643
+ export { ListEmailTemplatesSchema as a, UpdateWorkflowConfigSchema as i, WORKFLOW_OAUTH_SCOPES as n, ListWorkflowsSchema as o, getWorkflowTools as r, WorkflowsMixin as t };
644
+
645
+ //# sourceMappingURL=graphql-BLrX1gBY.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graphql-BLrX1gBY.mjs","names":["types.WorkflowsListDocument","types.WorkflowsUpdateConfigDocument","types.WorkflowsReadConfigDocument","types.WorkflowsListTemplatesDocument"],"sources":["../src/tools/workflows_list.ts","../src/tools/workflows_list_email_templates.ts","../src/tools/workflows_update_config.ts","../src/tools/index.ts","../src/scopes.ts","../src/__generated__/graphql.ts","../src/__generated__/gql.ts","../src/graphql.ts"],"sourcesContent":["import {\n createListResult,\n defineTool,\n PaginationSchema,\n z,\n type ToolClients,\n} from '@transcend-io/mcp-server-base';\n\nimport type { WorkflowsMixin } from '../graphql.js';\n\nexport const ListWorkflowsSchema = PaginationSchema.extend({\n cursor: z\n .string()\n .optional()\n .describe('Pagination cursor from previous response (where supported)'),\n});\nexport type ListWorkflowsInput = z.infer<typeof ListWorkflowsSchema>;\n\nexport function createWorkflowsListTool(clients: ToolClients) {\n const graphql = clients.graphql as WorkflowsMixin;\n return defineTool({\n name: 'workflows_list',\n description:\n 'List all workflows configured in your organization. Note: API does not support cursor pagination (max ~100 results).',\n category: 'Workflows',\n readOnly: true,\n annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },\n zodSchema: ListWorkflowsSchema,\n handler: async ({ limit, cursor }) => {\n const result = await graphql.listWorkflows({\n first: limit,\n after: cursor,\n });\n\n return createListResult(result.nodes, {\n totalCount: result.totalCount,\n hasNextPage: result.pageInfo?.hasNextPage,\n });\n },\n });\n}\n","import {\n createListResult,\n defineTool,\n PaginationSchema,\n z,\n type ToolClients,\n} from '@transcend-io/mcp-server-base';\n\nimport type { WorkflowsMixin } from '../graphql.js';\n\nexport const ListEmailTemplatesSchema = PaginationSchema.extend({\n cursor: z\n .string()\n .optional()\n .describe('Pagination cursor from previous response (where supported)'),\n offset: z.coerce\n .number()\n .min(0)\n .optional()\n .default(0)\n .describe('Number of results to skip (default: 0)'),\n});\nexport type ListEmailTemplatesInput = z.infer<typeof ListEmailTemplatesSchema>;\n\nexport function createWorkflowsListEmailTemplatesTool(clients: ToolClients) {\n const graphql = clients.graphql as WorkflowsMixin;\n return defineTool({\n name: 'workflows_list_email_templates',\n description:\n 'List all email templates used in workflows and communications. Note: API does not support cursor pagination (max ~100 results).',\n category: 'Workflows',\n readOnly: true,\n annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },\n zodSchema: ListEmailTemplatesSchema,\n handler: async ({ limit, offset }) => {\n const result = await graphql.listEmailTemplates({\n first: limit,\n offset,\n });\n\n return createListResult(result.nodes, {\n totalCount: result.totalCount,\n hasNextPage: result.pageInfo?.hasNextPage,\n });\n },\n });\n}\n","import { createToolResult, defineTool, z, type ToolClients } from '@transcend-io/mcp-server-base';\n\nimport type { WorkflowsMixin } from '../graphql.js';\n\nexport const UpdateWorkflowConfigSchema = z.object({\n workflowConfigId: z\n .string()\n .describe('ID of the workflow config to update (use workflows_list to find config IDs)'),\n title: z.string().optional().describe('New title for the workflow'),\n subtitle: z.string().optional().describe('New subtitle for the workflow'),\n description: z.string().optional().describe('New description for the workflow'),\n});\nexport type UpdateWorkflowConfigInput = z.infer<typeof UpdateWorkflowConfigSchema>;\n\nexport function createWorkflowsUpdateConfigTool(clients: ToolClients) {\n const graphql = clients.graphql as WorkflowsMixin;\n return defineTool({\n name: 'workflows_update_config',\n description:\n 'Update the configuration for a workflow. Supported fields: title, subtitle, description. ' +\n \"Note: privacy-center visibility is controlled by the workflow config's visibility tier and \" +\n 'is not editable through this tool.',\n category: 'Workflows',\n readOnly: false,\n confirmationHint: 'Updates the workflow configuration',\n annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },\n zodSchema: UpdateWorkflowConfigSchema,\n handler: async ({ workflowConfigId, title, subtitle, description }) => {\n const updates: {\n title?: string;\n subtitle?: string;\n description?: string;\n } = {};\n\n if (title !== undefined) updates.title = title;\n if (subtitle !== undefined) updates.subtitle = subtitle;\n if (description !== undefined) updates.description = description;\n\n const result = await graphql.updateWorkflowConfig(workflowConfigId, updates);\n\n return createToolResult(true, {\n workflowConfig: result,\n message: 'Workflow configuration updated successfully',\n });\n },\n });\n}\n","import type { ToolDefinition, ToolClients } from '@transcend-io/mcp-server-base';\n\nimport { createWorkflowsListTool } from './workflows_list.js';\nimport { createWorkflowsListEmailTemplatesTool } from './workflows_list_email_templates.js';\nimport { createWorkflowsUpdateConfigTool } from './workflows_update_config.js';\n\nexport function getWorkflowTools(clients: ToolClients): ToolDefinition[] {\n return [\n createWorkflowsListTool(clients),\n createWorkflowsUpdateConfigTool(clients),\n createWorkflowsListEmailTemplatesTool(clients),\n ];\n}\n","import { ScopeName } from '@transcend-io/privacy-types';\n\n/** OAuth scopes required for Workflow MCP tools (offline_access added by base). */\nexport const WORKFLOW_OAUTH_SCOPES = [\n ScopeName.ViewAllActionItems,\n ScopeName.ManageAllActionItems,\n ScopeName.ViewEmailTemplates,\n] as const;\n","/* eslint-disable */\n/** Internal type. DO NOT USE DIRECTLY. */\ntype Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };\n/** Internal type. DO NOT USE DIRECTLY. */\nexport type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };\nimport type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';\nexport type CollectDataSubjectRegions =\n | 'COLLECT'\n | 'DO_NOT_COLLECT';\n\nexport type ExpiryTimeInput = {\n region: string;\n value: number;\n};\n\nexport type RequestAction =\n | 'ACCESS'\n | 'AUTOMATED_DECISION_MAKING_OPT_IN'\n | 'AUTOMATED_DECISION_MAKING_OPT_OUT'\n | 'BUSINESS_PURPOSE'\n | 'CONTACT_OPT_IN'\n | 'CONTACT_OPT_OUT'\n | 'CUSTOM_OPT_IN'\n | 'CUSTOM_OPT_OUT'\n | 'ERASURE'\n | 'PLACE_ON_LEGAL_HOLD'\n | 'RECTIFICATION'\n | 'REMOVE_FROM_LEGAL_HOLD'\n | 'RESTRICTION'\n | 'SALE_OPT_IN'\n | 'SALE_OPT_OUT'\n | 'TRACKING_OPT_IN'\n | 'TRACKING_OPT_OUT'\n | 'USE_OF_SENSITIVE_INFORMATION_OPT_IN'\n | 'USE_OF_SENSITIVE_INFORMATION_OPT_OUT';\n\nexport type TemplateType =\n | 'EMAIL'\n | 'TEXT';\n\nexport type UpdateWorkflowConfigInput = {\n actionType?: RequestAction | null | undefined;\n attributeKeyIds?: Array<string | number> | null | undefined;\n collectDataSubjectRegions?: CollectDataSubjectRegions | null | undefined;\n completedSteps?: Array<WorkflowCompletedStepInput> | null | undefined;\n description?: string | null | undefined;\n expiryTime?: Array<ExpiryTimeInput> | null | undefined;\n inputIdentifierIds?: Array<string | number> | null | undefined;\n internalName?: string | null | undefined;\n purposeId?: string | number | null | undefined;\n regionList?: Array<string> | null | undefined;\n subjectId?: string | number | null | undefined;\n subtitle?: string | null | undefined;\n title?: string | null | undefined;\n workflowConfigId: string | number;\n workflowConfigVisibility?: WorkflowConfigVisibility | null | undefined;\n};\n\nexport type WorkflowCompletedStepInput = {\n step: string;\n value: WorkflowStepCompletionState;\n};\n\nexport type WorkflowConfigInput = {\n id: string | number;\n};\n\nexport type WorkflowConfigVisibility =\n | 'DRAFT'\n | 'INTERNAL'\n | 'PUBLISHED';\n\nexport type WorkflowStepCompletionState =\n | 'COMPLETED'\n | 'NOT_COMPLETED';\n\nexport type WorkflowsListQueryVariables = Exact<{\n first?: number | null | undefined;\n}>;\n\n\nexport type WorkflowsListQuery = { workflows: { totalCount: number, nodes: Array<{ id: string, title: { defaultMessage: string } }> } };\n\nexport type WorkflowsUpdateConfigMutationVariables = Exact<{\n input: UpdateWorkflowConfigInput;\n}>;\n\n\nexport type WorkflowsUpdateConfigMutation = { updateWorkflowConfig: { success: boolean } };\n\nexport type WorkflowsReadConfigQueryVariables = Exact<{\n input: WorkflowConfigInput;\n}>;\n\n\nexport type WorkflowsReadConfigQuery = { workflowConfig: { workflowConfig: { id: string, title: { defaultMessage: string }, subtitle: { defaultMessage: string } | null, description: { defaultMessage: string } | null } } };\n\nexport type WorkflowsListTemplatesQueryVariables = Exact<{\n first?: number | null | undefined;\n offset?: number | null | undefined;\n}>;\n\n\nexport type WorkflowsListTemplatesQuery = { templates: { totalCount: number, nodes: Array<{ id: string, title: string, type: TemplateType, isRequired: boolean }> } };\n\n\nexport const WorkflowsListDocument = {\"kind\":\"Document\",\"definitions\":[{\"kind\":\"OperationDefinition\",\"operation\":\"query\",\"name\":{\"kind\":\"Name\",\"value\":\"WorkflowsList\"},\"variableDefinitions\":[{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"first\"}},\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"Int\"}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"workflows\"},\"arguments\":[{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"first\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"first\"}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"nodes\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"title\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"defaultMessage\"}}]}}]}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"totalCount\"}}]}}]}}]} as unknown as DocumentNode<WorkflowsListQuery, WorkflowsListQueryVariables>;\nexport const WorkflowsUpdateConfigDocument = {\"kind\":\"Document\",\"definitions\":[{\"kind\":\"OperationDefinition\",\"operation\":\"mutation\",\"name\":{\"kind\":\"Name\",\"value\":\"WorkflowsUpdateConfig\"},\"variableDefinitions\":[{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"input\"}},\"type\":{\"kind\":\"NonNullType\",\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"UpdateWorkflowConfigInput\"}}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"updateWorkflowConfig\"},\"arguments\":[{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"input\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"input\"}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"success\"}}]}}]}}]} as unknown as DocumentNode<WorkflowsUpdateConfigMutation, WorkflowsUpdateConfigMutationVariables>;\nexport const WorkflowsReadConfigDocument = {\"kind\":\"Document\",\"definitions\":[{\"kind\":\"OperationDefinition\",\"operation\":\"query\",\"name\":{\"kind\":\"Name\",\"value\":\"WorkflowsReadConfig\"},\"variableDefinitions\":[{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"input\"}},\"type\":{\"kind\":\"NonNullType\",\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"WorkflowConfigInput\"}}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"workflowConfig\"},\"arguments\":[{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"input\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"input\"}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"workflowConfig\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"title\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"defaultMessage\"}}]}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"subtitle\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"defaultMessage\"}}]}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"description\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"defaultMessage\"}}]}}]}}]}}]}}]} as unknown as DocumentNode<WorkflowsReadConfigQuery, WorkflowsReadConfigQueryVariables>;\nexport const WorkflowsListTemplatesDocument = {\"kind\":\"Document\",\"definitions\":[{\"kind\":\"OperationDefinition\",\"operation\":\"query\",\"name\":{\"kind\":\"Name\",\"value\":\"WorkflowsListTemplates\"},\"variableDefinitions\":[{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"first\"}},\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"Int\"}}},{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"offset\"}},\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"Int\"}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"templates\"},\"arguments\":[{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"first\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"first\"}}},{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"offset\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"offset\"}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"nodes\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"title\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"type\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"isRequired\"}}]}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"totalCount\"}}]}}]}}]} as unknown as DocumentNode<WorkflowsListTemplatesQuery, WorkflowsListTemplatesQueryVariables>;","/* eslint-disable */\nimport * as types from './graphql.js';\nimport type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';\n\n/**\n * Map of all GraphQL operations in the project.\n *\n * This map has several performance disadvantages:\n * 1. It is not tree-shakeable, so it will include all operations in the project.\n * 2. It is not minifiable, so the string of a GraphQL query will be multiple times inside the bundle.\n * 3. It does not support dead code elimination, so it will add unused operations.\n *\n * Therefore it is highly recommended to use the babel or swc plugin for production.\n * Learn more about it here: https://the-guild.dev/graphql/codegen/plugins/presets/preset-client#reducing-bundle-size\n */\ntype Documents = {\n \"\\n query WorkflowsList($first: Int) {\\n workflows(first: $first) {\\n nodes {\\n id\\n title {\\n defaultMessage\\n }\\n }\\n totalCount\\n }\\n }\\n\": typeof types.WorkflowsListDocument,\n \"\\n mutation WorkflowsUpdateConfig($input: UpdateWorkflowConfigInput!) {\\n updateWorkflowConfig(input: $input) {\\n success\\n }\\n }\\n\": typeof types.WorkflowsUpdateConfigDocument,\n \"\\n query WorkflowsReadConfig($input: WorkflowConfigInput!) {\\n workflowConfig(input: $input) {\\n workflowConfig {\\n id\\n title {\\n defaultMessage\\n }\\n subtitle {\\n defaultMessage\\n }\\n description {\\n defaultMessage\\n }\\n }\\n }\\n }\\n\": typeof types.WorkflowsReadConfigDocument,\n \"\\n query WorkflowsListTemplates($first: Int, $offset: Int) {\\n templates(first: $first, offset: $offset) {\\n nodes {\\n id\\n title\\n type\\n isRequired\\n }\\n totalCount\\n }\\n }\\n\": typeof types.WorkflowsListTemplatesDocument,\n};\nconst documents: Documents = {\n \"\\n query WorkflowsList($first: Int) {\\n workflows(first: $first) {\\n nodes {\\n id\\n title {\\n defaultMessage\\n }\\n }\\n totalCount\\n }\\n }\\n\": types.WorkflowsListDocument,\n \"\\n mutation WorkflowsUpdateConfig($input: UpdateWorkflowConfigInput!) {\\n updateWorkflowConfig(input: $input) {\\n success\\n }\\n }\\n\": types.WorkflowsUpdateConfigDocument,\n \"\\n query WorkflowsReadConfig($input: WorkflowConfigInput!) {\\n workflowConfig(input: $input) {\\n workflowConfig {\\n id\\n title {\\n defaultMessage\\n }\\n subtitle {\\n defaultMessage\\n }\\n description {\\n defaultMessage\\n }\\n }\\n }\\n }\\n\": types.WorkflowsReadConfigDocument,\n \"\\n query WorkflowsListTemplates($first: Int, $offset: Int) {\\n templates(first: $first, offset: $offset) {\\n nodes {\\n id\\n title\\n type\\n isRequired\\n }\\n totalCount\\n }\\n }\\n\": types.WorkflowsListTemplatesDocument,\n};\n\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n *\n *\n * @example\n * ```ts\n * const query = graphql(`query GetUser($id: ID!) { user(id: $id) { name } }`);\n * ```\n *\n * The query argument is unknown!\n * Please regenerate the types.\n */\nexport function graphql(source: string): unknown;\n\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(source: \"\\n query WorkflowsList($first: Int) {\\n workflows(first: $first) {\\n nodes {\\n id\\n title {\\n defaultMessage\\n }\\n }\\n totalCount\\n }\\n }\\n\"): (typeof documents)[\"\\n query WorkflowsList($first: Int) {\\n workflows(first: $first) {\\n nodes {\\n id\\n title {\\n defaultMessage\\n }\\n }\\n totalCount\\n }\\n }\\n\"];\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(source: \"\\n mutation WorkflowsUpdateConfig($input: UpdateWorkflowConfigInput!) {\\n updateWorkflowConfig(input: $input) {\\n success\\n }\\n }\\n\"): (typeof documents)[\"\\n mutation WorkflowsUpdateConfig($input: UpdateWorkflowConfigInput!) {\\n updateWorkflowConfig(input: $input) {\\n success\\n }\\n }\\n\"];\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(source: \"\\n query WorkflowsReadConfig($input: WorkflowConfigInput!) {\\n workflowConfig(input: $input) {\\n workflowConfig {\\n id\\n title {\\n defaultMessage\\n }\\n subtitle {\\n defaultMessage\\n }\\n description {\\n defaultMessage\\n }\\n }\\n }\\n }\\n\"): (typeof documents)[\"\\n query WorkflowsReadConfig($input: WorkflowConfigInput!) {\\n workflowConfig(input: $input) {\\n workflowConfig {\\n id\\n title {\\n defaultMessage\\n }\\n subtitle {\\n defaultMessage\\n }\\n description {\\n defaultMessage\\n }\\n }\\n }\\n }\\n\"];\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(source: \"\\n query WorkflowsListTemplates($first: Int, $offset: Int) {\\n templates(first: $first, offset: $offset) {\\n nodes {\\n id\\n title\\n type\\n isRequired\\n }\\n totalCount\\n }\\n }\\n\"): (typeof documents)[\"\\n query WorkflowsListTemplates($first: Int, $offset: Int) {\\n templates(first: $first, offset: $offset) {\\n nodes {\\n id\\n title\\n type\\n isRequired\\n }\\n totalCount\\n }\\n }\\n\"];\n\nexport function graphql(source: string) {\n return (documents as any)[source] ?? {};\n}\n\nexport type DocumentType<TDocumentNode extends DocumentNode<any, any>> = TDocumentNode extends DocumentNode< infer TType, any> ? TType : never;","import {\n TranscendGraphQLBase,\n type EmailTemplate,\n type ListOptions,\n type PaginatedResponse,\n type Workflow,\n type WorkflowConfig,\n} from '@transcend-io/mcp-server-base';\n\nimport { graphql } from './__generated__/gql.js';\n\nconst ListWorkflowsDoc = graphql(/* GraphQL */ `\n query WorkflowsList($first: Int) {\n workflows(first: $first) {\n nodes {\n id\n title {\n defaultMessage\n }\n }\n totalCount\n }\n }\n`);\n\n// `updateWorkflowConfig` returns only `{ success, clientMutationId }` per the\n// schema -- the previous selection requested a `workflowConfig` field that\n// never existed and would have errored at runtime if Transcend's API had\n// stricter validation. We split into a mutation + follow-up read so callers\n// still get a fully-shaped WorkflowConfig back.\nconst UpdateWorkflowConfigDoc = graphql(/* GraphQL */ `\n mutation WorkflowsUpdateConfig($input: UpdateWorkflowConfigInput!) {\n updateWorkflowConfig(input: $input) {\n success\n }\n }\n`);\n\n// Note: WorkflowConfig has no `showInPrivacyCenter` field (and the input type\n// has no corresponding setter). The MCP tool used to advertise this option,\n// but it was a no-op against the schema -- removed from the surface area.\nconst ReadWorkflowConfigDoc = graphql(/* GraphQL */ `\n query WorkflowsReadConfig($input: WorkflowConfigInput!) {\n workflowConfig(input: $input) {\n workflowConfig {\n id\n title {\n defaultMessage\n }\n subtitle {\n defaultMessage\n }\n description {\n defaultMessage\n }\n }\n }\n }\n`);\n\nconst ListEmailTemplatesDoc = graphql(/* GraphQL */ `\n query WorkflowsListTemplates($first: Int, $offset: Int) {\n templates(first: $first, offset: $offset) {\n nodes {\n id\n title\n type\n isRequired\n }\n totalCount\n }\n }\n`);\n\nexport class WorkflowsMixin extends TranscendGraphQLBase {\n async listWorkflows(options?: ListOptions): Promise<PaginatedResponse<Workflow>> {\n const data = await this.makeRequest(ListWorkflowsDoc, {\n first: Math.min(options?.first ?? 50, 100),\n });\n return {\n nodes: data.workflows.nodes.map((w) => ({\n id: w.id,\n title: { defaultMessage: w.title.defaultMessage },\n })),\n pageInfo: {\n hasNextPage: data.workflows.nodes.length < data.workflows.totalCount,\n hasPreviousPage: false,\n },\n totalCount: data.workflows.totalCount,\n };\n }\n\n async updateWorkflowConfig(\n workflowConfigId: string,\n updates: {\n title?: string;\n subtitle?: string;\n description?: string;\n },\n ): Promise<WorkflowConfig> {\n await this.makeRequest(UpdateWorkflowConfigDoc, {\n input: { workflowConfigId, ...updates },\n });\n const data = await this.makeRequest(ReadWorkflowConfigDoc, {\n input: { id: workflowConfigId },\n });\n const wc = data.workflowConfig.workflowConfig;\n return {\n id: wc.id,\n title: wc.title.defaultMessage,\n subtitle: wc.subtitle?.defaultMessage ?? '',\n description: wc.description?.defaultMessage ?? '',\n };\n }\n\n async listEmailTemplates(options?: ListOptions): Promise<PaginatedResponse<EmailTemplate>> {\n const data = await this.makeRequest(ListEmailTemplatesDoc, {\n first: Math.min(options?.first ?? 50, 100),\n offset: options?.offset ?? 0,\n });\n const templates: EmailTemplate[] = data.templates.nodes.map((t) => ({\n id: t.id,\n name: t.title,\n subject: '',\n type: t.type,\n locale: '',\n isActive: t.isRequired,\n createdAt: '',\n updatedAt: '',\n }));\n return {\n nodes: templates,\n pageInfo: {\n hasNextPage: templates.length < data.templates.totalCount,\n hasPreviousPage: false,\n },\n totalCount: data.templates.totalCount,\n };\n }\n}\n"],"mappings":";;;AAUA,MAAa,sBAAsB,iBAAiB,OAAO,EACzD,QAAQ,EACL,QAAQ,CACR,UAAU,CACV,SAAS,6DAA6D,EAC1E,CAAC;AAGF,SAAgB,wBAAwB,SAAsB;CAC5D,MAAM,UAAU,QAAQ;AACxB,QAAO,WAAW;EAChB,MAAM;EACN,aACE;EACF,UAAU;EACV,UAAU;EACV,aAAa;GAAE,cAAc;GAAM,iBAAiB;GAAO,gBAAgB;GAAM;EACjF,WAAW;EACX,SAAS,OAAO,EAAE,OAAO,aAAa;GACpC,MAAM,SAAS,MAAM,QAAQ,cAAc;IACzC,OAAO;IACP,OAAO;IACR,CAAC;AAEF,UAAO,iBAAiB,OAAO,OAAO;IACpC,YAAY,OAAO;IACnB,aAAa,OAAO,UAAU;IAC/B,CAAC;;EAEL,CAAC;;;;AC7BJ,MAAa,2BAA2B,iBAAiB,OAAO;CAC9D,QAAQ,EACL,QAAQ,CACR,UAAU,CACV,SAAS,6DAA6D;CACzE,QAAQ,EAAE,OACP,QAAQ,CACR,IAA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U;GAC5B,CAAC;EACF,MAAM,YAA6B,KAAK,UAAU,MAAM,KAAK,OAAO;GAClE,IAAI,EAAE;GACN,MAAM,EAAE;GACR,SAAS;GACT,MAAM,EAAE;GACR,QAAQ;GACR,UAAU,EAAE;GACZ,WAAW;GACX,WAAW;GACZ,EAAE;AACH,SAAO;GACL,OAAO;GACP,UAAU;IACR,aAAa,UAAU,SAAS,KAAK,UAAU;IAC/C,iBAAiB;IAClB;GACD,YAAY,KAAK,UAAU;GAC5B"}
package/dist/index.d.mts CHANGED
@@ -1,8 +1,13 @@
1
1
  import { EmailTemplate, ListOptions, PaginatedResponse, ToolClients, ToolDefinition, TranscendGraphQLBase, Workflow, WorkflowConfig, z } from "@transcend-io/mcp-server-base";
2
+ import { ScopeName } from "@transcend-io/privacy-types";
2
3
 
3
4
  //#region src/tools/index.d.ts
4
5
  declare function getWorkflowTools(clients: ToolClients): ToolDefinition[];
5
6
  //#endregion
7
+ //#region src/scopes.d.ts
8
+ /** OAuth scopes required for Workflow MCP tools (offline_access added by base). */
9
+ declare const WORKFLOW_OAUTH_SCOPES: readonly [ScopeName.ViewAllActionItems, ScopeName.ManageAllActionItems, ScopeName.ViewEmailTemplates];
10
+ //#endregion
6
11
  //#region src/graphql.d.ts
7
12
  declare class WorkflowsMixin extends TranscendGraphQLBase {
8
13
  listWorkflows(options?: ListOptions): Promise<PaginatedResponse<Workflow>>;
@@ -10,7 +15,6 @@ declare class WorkflowsMixin extends TranscendGraphQLBase {
10
15
  title?: string;
11
16
  subtitle?: string;
12
17
  description?: string;
13
- showInPrivacyCenter?: boolean;
14
18
  }): Promise<WorkflowConfig>;
15
19
  listEmailTemplates(options?: ListOptions): Promise<PaginatedResponse<EmailTemplate>>;
16
20
  }
@@ -32,13 +36,12 @@ type ListEmailTemplatesInput = z.infer<typeof ListEmailTemplatesSchema>;
32
36
  //#endregion
33
37
  //#region src/tools/workflows_update_config.d.ts
34
38
  declare const UpdateWorkflowConfigSchema: z.ZodObject<{
35
- workflow_config_id: z.ZodString;
39
+ workflowConfigId: z.ZodString;
36
40
  title: z.ZodOptional<z.ZodString>;
37
41
  subtitle: z.ZodOptional<z.ZodString>;
38
42
  description: z.ZodOptional<z.ZodString>;
39
- show_in_privacy_center: z.ZodOptional<z.ZodBoolean>;
40
43
  }, z.core.$strip>;
41
44
  type UpdateWorkflowConfigInput = z.infer<typeof UpdateWorkflowConfigSchema>;
42
45
  //#endregion
43
- export { type ListEmailTemplatesInput, ListEmailTemplatesSchema, type ListWorkflowsInput, ListWorkflowsSchema, type UpdateWorkflowConfigInput, UpdateWorkflowConfigSchema, WorkflowsMixin, getWorkflowTools };
46
+ export { type ListEmailTemplatesInput, ListEmailTemplatesSchema, type ListWorkflowsInput, ListWorkflowsSchema, type UpdateWorkflowConfigInput, UpdateWorkflowConfigSchema, WORKFLOW_OAUTH_SCOPES, WorkflowsMixin, getWorkflowTools };
44
47
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/tools/index.ts","../src/graphql.ts","../src/tools/workflows_list.ts","../src/tools/workflows_list_email_templates.ts","../src/tools/workflows_update_config.ts"],"mappings":";;;iBAMgB,gBAAA,CAAiB,OAAA,EAAS,WAAA,GAAc,cAAA;;;cCG3C,cAAA,SAAuB,oBAAA;EAC5B,aAAA,CAAc,OAAA,GAAU,WAAA,GAAc,OAAA,CAAQ,iBAAA,CAAkB,QAAA;EA4BhE,oBAAA,CACJ,gBAAA,UACA,OAAA;IACE,KAAA;IACA,QAAA;IACA,WAAA;IACA,mBAAA;EAAA,IAED,OAAA,CAAQ,cAAA;EA0CL,kBAAA,CAAmB,OAAA,GAAU,WAAA,GAAc,OAAA,CAAQ,iBAAA,CAAkB,aAAA;AAAA;;;cC9EhE,mBAAA,EAAmB,CAAA,CAAA,SAAA;;;;KAMpB,kBAAA,GAAqB,CAAA,CAAE,KAAA,QAAa,mBAAA;;;cCNnC,wBAAA,EAAwB,CAAA,CAAA,SAAA;;;;;KAYzB,uBAAA,GAA0B,CAAA,CAAE,KAAA,QAAa,wBAAA;;;cClBxC,0BAAA,EAA0B,CAAA,CAAA,SAAA;;;;;;;KAY3B,yBAAA,GAA4B,CAAA,CAAE,KAAA,QAAa,0BAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/tools/index.ts","../src/scopes.ts","../src/graphql.ts","../src/tools/workflows_list.ts","../src/tools/workflows_list_email_templates.ts","../src/tools/workflows_update_config.ts"],"mappings":";;;;iBAMgB,gBAAA,CAAiB,OAAA,EAAS,WAAA,GAAc,cAAA;;;;cCH3C,qBAAA,YAAqB,SAAA,CAAA,kBAAA,EAAA,SAAA,CAAA,oBAAA,EAAA,SAAA,CAAA,kBAAA;;;cCuErB,cAAA,SAAuB,oBAAA;EAC5B,aAAA,CAAc,OAAA,GAAU,WAAA,GAAc,OAAA,CAAQ,iBAAA,CAAkB,QAAA;EAiBhE,oBAAA,CACJ,gBAAA,UACA,OAAA;IACE,KAAA;IACA,QAAA;IACA,WAAA;EAAA,IAED,OAAA,CAAQ,cAAA;EAgBL,kBAAA,CAAmB,OAAA,GAAU,WAAA,GAAc,OAAA,CAAQ,iBAAA,CAAkB,aAAA;AAAA;;;cCzGhE,mBAAA,EAAmB,CAAA,CAAA,SAAA;;;;KAMpB,kBAAA,GAAqB,CAAA,CAAE,KAAA,QAAa,mBAAA;;;cCNnC,wBAAA,EAAwB,CAAA,CAAA,SAAA;;;;;KAYzB,uBAAA,GAA0B,CAAA,CAAE,KAAA,QAAa,wBAAA;;;cClBxC,0BAAA,EAA0B,CAAA,CAAA,SAAA;;;;;;KAQ3B,yBAAA,GAA4B,CAAA,CAAE,KAAA,QAAa,0BAAA"}
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { a as ListWorkflowsSchema, i as ListEmailTemplatesSchema, n as getWorkflowTools, r as UpdateWorkflowConfigSchema, t as WorkflowsMixin } from "./graphql-oANS0b0T.mjs";
2
- export { ListEmailTemplatesSchema, ListWorkflowsSchema, UpdateWorkflowConfigSchema, WorkflowsMixin, getWorkflowTools };
1
+ import { a as ListEmailTemplatesSchema, i as UpdateWorkflowConfigSchema, n as WORKFLOW_OAUTH_SCOPES, o as ListWorkflowsSchema, r as getWorkflowTools, t as WorkflowsMixin } from "./graphql-BLrX1gBY.mjs";
2
+ export { ListEmailTemplatesSchema, ListWorkflowsSchema, UpdateWorkflowConfigSchema, WORKFLOW_OAUTH_SCOPES, WorkflowsMixin, getWorkflowTools };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transcend-io/mcp-server-workflows",
3
- "version": "0.3.4",
3
+ "version": "0.4.0",
4
4
  "description": "Transcend MCP Server — Workflows tools.",
5
5
  "homepage": "https://github.com/transcend-io/tools/tree/main/packages/mcp/mcp-server-workflows",
6
6
  "license": "Apache-2.0",
@@ -30,16 +30,19 @@
30
30
  "access": "public"
31
31
  },
32
32
  "dependencies": {
33
+ "@graphql-typed-document-node/core": "^3.2.0",
33
34
  "@modelcontextprotocol/sdk": "^1.29.0",
35
+ "graphql": "^16.14.0",
34
36
  "zod": "^4.3.6",
35
- "@transcend-io/mcp-server-base": "0.4.3"
37
+ "@transcend-io/mcp-server-base": "0.5.0",
38
+ "@transcend-io/privacy-types": "5.3.2"
36
39
  },
37
40
  "devDependencies": {
38
41
  "@arethetypeswrong/cli": "^0.18.2",
39
42
  "@types/node": "^22.19.15",
40
43
  "publint": "^0.3.18",
41
44
  "tsdown": "^0.21.2",
42
- "typescript": "^5.9.3",
45
+ "typescript": "^6.0.0",
43
46
  "vitest": "^4.0.18"
44
47
  },
45
48
  "engines": {
@@ -1,204 +0,0 @@
1
- import { PaginationSchema, TranscendGraphQLBase, createListResult, createToolResult, defineTool, z } from "@transcend-io/mcp-server-base";
2
- //#region src/tools/workflows_list.ts
3
- const ListWorkflowsSchema = PaginationSchema.extend({ cursor: z.string().optional().describe("Pagination cursor from previous response (where supported)") });
4
- function createWorkflowsListTool(clients) {
5
- const graphql = clients.graphql;
6
- return defineTool({
7
- name: "workflows_list",
8
- description: "List all workflows configured in your organization. Note: API does not support cursor pagination (max ~100 results).",
9
- category: "Workflows",
10
- readOnly: true,
11
- annotations: {
12
- readOnlyHint: true,
13
- destructiveHint: false,
14
- idempotentHint: true
15
- },
16
- zodSchema: ListWorkflowsSchema,
17
- handler: async ({ limit, cursor }) => {
18
- const result = await graphql.listWorkflows({
19
- first: limit,
20
- after: cursor
21
- });
22
- return createListResult(result.nodes, {
23
- totalCount: result.totalCount,
24
- hasNextPage: result.pageInfo?.hasNextPage
25
- });
26
- }
27
- });
28
- }
29
- //#endregion
30
- //#region src/tools/workflows_list_email_templates.ts
31
- const ListEmailTemplatesSchema = PaginationSchema.extend({
32
- cursor: z.string().optional().describe("Pagination cursor from previous response (where supported)"),
33
- offset: z.coerce.number().min(0).optional().default(0).describe("Number of results to skip (default: 0)")
34
- });
35
- function createWorkflowsListEmailTemplatesTool(clients) {
36
- const graphql = clients.graphql;
37
- return defineTool({
38
- name: "workflows_list_email_templates",
39
- description: "List all email templates used in workflows and communications. Note: API does not support cursor pagination (max ~100 results).",
40
- category: "Workflows",
41
- readOnly: true,
42
- annotations: {
43
- readOnlyHint: true,
44
- destructiveHint: false,
45
- idempotentHint: true
46
- },
47
- zodSchema: ListEmailTemplatesSchema,
48
- handler: async ({ limit, offset }) => {
49
- const result = await graphql.listEmailTemplates({
50
- first: limit,
51
- offset
52
- });
53
- return createListResult(result.nodes, {
54
- totalCount: result.totalCount,
55
- hasNextPage: result.pageInfo?.hasNextPage
56
- });
57
- }
58
- });
59
- }
60
- //#endregion
61
- //#region src/tools/workflows_update_config.ts
62
- const UpdateWorkflowConfigSchema = z.object({
63
- workflow_config_id: z.string().describe("ID of the workflow config to update (use workflows_list to find config IDs)"),
64
- title: z.string().optional().describe("New title for the workflow"),
65
- subtitle: z.string().optional().describe("New subtitle for the workflow"),
66
- description: z.string().optional().describe("New description for the workflow"),
67
- show_in_privacy_center: z.boolean().optional().describe("Whether to show this workflow in the Privacy Center")
68
- });
69
- function createWorkflowsUpdateConfigTool(clients) {
70
- const graphql = clients.graphql;
71
- return defineTool({
72
- name: "workflows_update_config",
73
- description: "Update the configuration for a workflow (title, subtitle, description, privacy center visibility)",
74
- category: "Workflows",
75
- readOnly: false,
76
- confirmationHint: "Updates the workflow configuration",
77
- annotations: {
78
- readOnlyHint: false,
79
- destructiveHint: false,
80
- idempotentHint: true
81
- },
82
- zodSchema: UpdateWorkflowConfigSchema,
83
- handler: async ({ workflow_config_id, title, subtitle, description, show_in_privacy_center }) => {
84
- const updates = {};
85
- if (title !== void 0) updates.title = title;
86
- if (subtitle !== void 0) updates.subtitle = subtitle;
87
- if (description !== void 0) updates.description = description;
88
- if (show_in_privacy_center !== void 0) updates.showInPrivacyCenter = show_in_privacy_center;
89
- return createToolResult(true, {
90
- workflowConfig: await graphql.updateWorkflowConfig(workflow_config_id, updates),
91
- message: "Workflow configuration updated successfully"
92
- });
93
- }
94
- });
95
- }
96
- //#endregion
97
- //#region src/tools/index.ts
98
- function getWorkflowTools(clients) {
99
- return [
100
- createWorkflowsListTool(clients),
101
- createWorkflowsUpdateConfigTool(clients),
102
- createWorkflowsListEmailTemplatesTool(clients)
103
- ];
104
- }
105
- //#endregion
106
- //#region src/graphql.ts
107
- var WorkflowsMixin = class extends TranscendGraphQLBase {
108
- async listWorkflows(options) {
109
- const data = await this.makeRequest(`
110
- query ListWorkflows($first: Int) {
111
- workflows(first: $first) {
112
- nodes {
113
- id
114
- title {
115
- defaultMessage
116
- }
117
- }
118
- totalCount
119
- }
120
- }
121
- `, { first: Math.min(options?.first || 50, 100) });
122
- return {
123
- nodes: data.workflows.nodes,
124
- pageInfo: {
125
- hasNextPage: data.workflows.nodes.length < data.workflows.totalCount,
126
- hasPreviousPage: false
127
- },
128
- totalCount: data.workflows.totalCount
129
- };
130
- }
131
- async updateWorkflowConfig(workflowConfigId, updates) {
132
- const mutation = `
133
- mutation UpdateWorkflowConfig($input: UpdateWorkflowConfigInput!) {
134
- updateWorkflowConfig(input: $input) {
135
- workflowConfig {
136
- id
137
- title {
138
- defaultMessage
139
- }
140
- subtitle {
141
- defaultMessage
142
- }
143
- description {
144
- defaultMessage
145
- }
146
- showInPrivacyCenter
147
- }
148
- }
149
- }
150
- `;
151
- const input = {
152
- workflowConfigId,
153
- ...updates
154
- };
155
- const wc = (await this.makeRequest(mutation, { input })).updateWorkflowConfig.workflowConfig;
156
- return {
157
- id: wc.id,
158
- title: wc.title?.defaultMessage || "",
159
- subtitle: wc.subtitle?.defaultMessage || "",
160
- description: wc.description?.defaultMessage || "",
161
- showInPrivacyCenter: wc.showInPrivacyCenter
162
- };
163
- }
164
- async listEmailTemplates(options) {
165
- const data = await this.makeRequest(`
166
- query ListTemplates($first: Int, $offset: Int) {
167
- templates(first: $first, offset: $offset) {
168
- nodes {
169
- id
170
- title
171
- type
172
- isRequired
173
- }
174
- totalCount
175
- }
176
- }
177
- `, {
178
- first: Math.min(options?.first || 50, 100),
179
- offset: options?.offset || 0
180
- });
181
- const templates = data.templates.nodes.map((t) => ({
182
- id: t.id,
183
- name: t.title,
184
- subject: "",
185
- type: t.type,
186
- locale: "",
187
- isActive: t.isRequired,
188
- createdAt: "",
189
- updatedAt: ""
190
- }));
191
- return {
192
- nodes: templates,
193
- pageInfo: {
194
- hasNextPage: templates.length < data.templates.totalCount,
195
- hasPreviousPage: false
196
- },
197
- totalCount: data.templates.totalCount
198
- };
199
- }
200
- };
201
- //#endregion
202
- export { ListWorkflowsSchema as a, ListEmailTemplatesSchema as i, getWorkflowTools as n, UpdateWorkflowConfigSchema as r, WorkflowsMixin as t };
203
-
204
- //# sourceMappingURL=graphql-oANS0b0T.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"graphql-oANS0b0T.mjs","names":[],"sources":["../src/tools/workflows_list.ts","../src/tools/workflows_list_email_templates.ts","../src/tools/workflows_update_config.ts","../src/tools/index.ts","../src/graphql.ts"],"sourcesContent":["import {\n createListResult,\n defineTool,\n PaginationSchema,\n z,\n type ToolClients,\n} from '@transcend-io/mcp-server-base';\n\nimport type { WorkflowsMixin } from '../graphql.js';\n\nexport const ListWorkflowsSchema = PaginationSchema.extend({\n cursor: z\n .string()\n .optional()\n .describe('Pagination cursor from previous response (where supported)'),\n});\nexport type ListWorkflowsInput = z.infer<typeof ListWorkflowsSchema>;\n\nexport function createWorkflowsListTool(clients: ToolClients) {\n const graphql = clients.graphql as WorkflowsMixin;\n return defineTool({\n name: 'workflows_list',\n description:\n 'List all workflows configured in your organization. Note: API does not support cursor pagination (max ~100 results).',\n category: 'Workflows',\n readOnly: true,\n annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },\n zodSchema: ListWorkflowsSchema,\n handler: async ({ limit, cursor }) => {\n const result = await graphql.listWorkflows({\n first: limit,\n after: cursor,\n });\n\n return createListResult(result.nodes, {\n totalCount: result.totalCount,\n hasNextPage: result.pageInfo?.hasNextPage,\n });\n },\n });\n}\n","import {\n createListResult,\n defineTool,\n PaginationSchema,\n z,\n type ToolClients,\n} from '@transcend-io/mcp-server-base';\n\nimport type { WorkflowsMixin } from '../graphql.js';\n\nexport const ListEmailTemplatesSchema = PaginationSchema.extend({\n cursor: z\n .string()\n .optional()\n .describe('Pagination cursor from previous response (where supported)'),\n offset: z.coerce\n .number()\n .min(0)\n .optional()\n .default(0)\n .describe('Number of results to skip (default: 0)'),\n});\nexport type ListEmailTemplatesInput = z.infer<typeof ListEmailTemplatesSchema>;\n\nexport function createWorkflowsListEmailTemplatesTool(clients: ToolClients) {\n const graphql = clients.graphql as WorkflowsMixin;\n return defineTool({\n name: 'workflows_list_email_templates',\n description:\n 'List all email templates used in workflows and communications. Note: API does not support cursor pagination (max ~100 results).',\n category: 'Workflows',\n readOnly: true,\n annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },\n zodSchema: ListEmailTemplatesSchema,\n handler: async ({ limit, offset }) => {\n const result = await graphql.listEmailTemplates({\n first: limit,\n offset,\n });\n\n return createListResult(result.nodes, {\n totalCount: result.totalCount,\n hasNextPage: result.pageInfo?.hasNextPage,\n });\n },\n });\n}\n","import { createToolResult, defineTool, z, type ToolClients } from '@transcend-io/mcp-server-base';\n\nimport type { WorkflowsMixin } from '../graphql.js';\n\nexport const UpdateWorkflowConfigSchema = z.object({\n workflow_config_id: z\n .string()\n .describe('ID of the workflow config to update (use workflows_list to find config IDs)'),\n title: z.string().optional().describe('New title for the workflow'),\n subtitle: z.string().optional().describe('New subtitle for the workflow'),\n description: z.string().optional().describe('New description for the workflow'),\n show_in_privacy_center: z\n .boolean()\n .optional()\n .describe('Whether to show this workflow in the Privacy Center'),\n});\nexport type UpdateWorkflowConfigInput = z.infer<typeof UpdateWorkflowConfigSchema>;\n\nexport function createWorkflowsUpdateConfigTool(clients: ToolClients) {\n const graphql = clients.graphql as WorkflowsMixin;\n return defineTool({\n name: 'workflows_update_config',\n description:\n 'Update the configuration for a workflow (title, subtitle, description, privacy center visibility)',\n category: 'Workflows',\n readOnly: false,\n confirmationHint: 'Updates the workflow configuration',\n annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },\n zodSchema: UpdateWorkflowConfigSchema,\n handler: async ({\n workflow_config_id,\n title,\n subtitle,\n description,\n show_in_privacy_center,\n }) => {\n const updates: {\n title?: string;\n subtitle?: string;\n description?: string;\n showInPrivacyCenter?: boolean;\n } = {};\n\n if (title !== undefined) {\n updates.title = title;\n }\n if (subtitle !== undefined) {\n updates.subtitle = subtitle;\n }\n if (description !== undefined) {\n updates.description = description;\n }\n if (show_in_privacy_center !== undefined) {\n updates.showInPrivacyCenter = show_in_privacy_center;\n }\n\n const result = await graphql.updateWorkflowConfig(workflow_config_id, updates);\n\n return createToolResult(true, {\n workflowConfig: result,\n message: 'Workflow configuration updated successfully',\n });\n },\n });\n}\n","import type { ToolDefinition, ToolClients } from '@transcend-io/mcp-server-base';\n\nimport { createWorkflowsListTool } from './workflows_list.js';\nimport { createWorkflowsListEmailTemplatesTool } from './workflows_list_email_templates.js';\nimport { createWorkflowsUpdateConfigTool } from './workflows_update_config.js';\n\nexport function getWorkflowTools(clients: ToolClients): ToolDefinition[] {\n return [\n createWorkflowsListTool(clients),\n createWorkflowsUpdateConfigTool(clients),\n createWorkflowsListEmailTemplatesTool(clients),\n ];\n}\n","import {\n TranscendGraphQLBase,\n type EmailTemplate,\n type ListOptions,\n type PaginatedResponse,\n type Workflow,\n type WorkflowConfig,\n} from '@transcend-io/mcp-server-base';\n\nexport class WorkflowsMixin extends TranscendGraphQLBase {\n async listWorkflows(options?: ListOptions): Promise<PaginatedResponse<Workflow>> {\n const query = `\n query ListWorkflows($first: Int) {\n workflows(first: $first) {\n nodes {\n id\n title {\n defaultMessage\n }\n }\n totalCount\n }\n }\n `;\n const data = await this.makeRequest<{ workflows: { nodes: Workflow[]; totalCount: number } }>(\n query,\n { first: Math.min(options?.first || 50, 100) },\n );\n return {\n nodes: data.workflows.nodes,\n pageInfo: {\n hasNextPage: data.workflows.nodes.length < data.workflows.totalCount,\n hasPreviousPage: false,\n },\n totalCount: data.workflows.totalCount,\n };\n }\n\n async updateWorkflowConfig(\n workflowConfigId: string,\n updates: {\n title?: string;\n subtitle?: string;\n description?: string;\n showInPrivacyCenter?: boolean;\n },\n ): Promise<WorkflowConfig> {\n const mutation = `\n mutation UpdateWorkflowConfig($input: UpdateWorkflowConfigInput!) {\n updateWorkflowConfig(input: $input) {\n workflowConfig {\n id\n title {\n defaultMessage\n }\n subtitle {\n defaultMessage\n }\n description {\n defaultMessage\n }\n showInPrivacyCenter\n }\n }\n }\n `;\n const input = { workflowConfigId, ...updates };\n const data = await this.makeRequest<{\n updateWorkflowConfig: {\n workflowConfig: {\n id: string;\n title: { defaultMessage: string } | null;\n subtitle: { defaultMessage: string } | null;\n description: { defaultMessage: string } | null;\n showInPrivacyCenter: boolean;\n };\n };\n }>(mutation, { input });\n const wc = data.updateWorkflowConfig.workflowConfig;\n return {\n id: wc.id,\n title: wc.title?.defaultMessage || '',\n subtitle: wc.subtitle?.defaultMessage || '',\n description: wc.description?.defaultMessage || '',\n showInPrivacyCenter: wc.showInPrivacyCenter,\n };\n }\n\n async listEmailTemplates(options?: ListOptions): Promise<PaginatedResponse<EmailTemplate>> {\n const query = `\n query ListTemplates($first: Int, $offset: Int) {\n templates(first: $first, offset: $offset) {\n nodes {\n id\n title\n type\n isRequired\n }\n totalCount\n }\n }\n `;\n const data = await this.makeRequest<{\n templates: {\n nodes: Array<{ id: string; title: string; type: string; isRequired: boolean }>;\n totalCount: number;\n };\n }>(query, {\n first: Math.min(options?.first || 50, 100),\n offset: options?.offset || 0,\n });\n const templates: EmailTemplate[] = data.templates.nodes.map((t) => ({\n id: t.id,\n name: t.title,\n subject: '',\n type: t.type,\n locale: '',\n isActive: t.isRequired,\n createdAt: '',\n updatedAt: '',\n }));\n return {\n nodes: templates,\n pageInfo: {\n hasNextPage: templates.length < data.templates.totalCount,\n hasPreviousPage: false,\n },\n totalCount: data.templates.totalCount,\n };\n }\n}\n"],"mappings":";;AAUA,MAAa,sBAAsB,iBAAiB,OAAO,EACzD,QAAQ,EACL,QAAQ,CACR,UAAU,CACV,SAAS,6DAA6D,EAC1E,CAAC;AAGF,SAAgB,wBAAwB,SAAsB;CAC5D,MAAM,UAAU,QAAQ;AACxB,QAAO,WAAW;EAChB,MAAM;EACN,aACE;EACF,UAAU;EACV,UAAU;EACV,aAAa;GAAE,cAAc;GAAM,iBAAiB;GAAO,gBAAgB;GAAM;EACjF,WAAW;EACX,SAAS,OAAO,EAAE,OAAO,aAAa;GACpC,MAAM,SAAS,MAAM,QAAQ,cAAc;IACzC,OAAO;IACP,OAAO;IACR,CAAC;AAEF,UAAO,iBAAiB,OAAO,OAAO;IACpC,YAAY,OAAO;IACnB,aAAa,OAAO,UAAU;IAC/B,CAAC;;EAEL,CAAC;;;;AC7BJ,MAAa,2BAA2B,iBAAiB,OAAO;CAC9D,QAAQ,EACL,QAAQ,CACR,UAAU,CACV,SAAS,6DAA6D;CACzE,Q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