@edicarlos.lds/businessmap-mcp 2.2.2 → 3.0.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.
Files changed (136) hide show
  1. package/README.md +1 -1
  2. package/dist/client/businessmap-client.d.ts +17 -83
  3. package/dist/client/businessmap-client.d.ts.map +1 -1
  4. package/dist/client/businessmap-client.js +27 -224
  5. package/dist/client/businessmap-client.js.map +1 -1
  6. package/dist/client/modules/board-client.d.ts +7 -3
  7. package/dist/client/modules/board-client.d.ts.map +1 -1
  8. package/dist/client/modules/board-client.js +12 -4
  9. package/dist/client/modules/board-client.js.map +1 -1
  10. package/dist/client/modules/card-client.d.ts +51 -1
  11. package/dist/client/modules/card-client.d.ts.map +1 -1
  12. package/dist/client/modules/card-client.js +93 -0
  13. package/dist/client/modules/card-client.js.map +1 -1
  14. package/dist/client/modules/custom-field-client.js +1 -1
  15. package/dist/client/modules/custom-field-client.js.map +1 -1
  16. package/dist/client/modules/doc-client.d.ts +44 -0
  17. package/dist/client/modules/doc-client.d.ts.map +1 -0
  18. package/dist/client/modules/doc-client.js +73 -0
  19. package/dist/client/modules/doc-client.js.map +1 -0
  20. package/dist/client/modules/index.d.ts +1 -0
  21. package/dist/client/modules/index.d.ts.map +1 -1
  22. package/dist/client/modules/index.js +1 -0
  23. package/dist/client/modules/index.js.map +1 -1
  24. package/dist/client/modules/workflow-client.d.ts +25 -1
  25. package/dist/client/modules/workflow-client.d.ts.map +1 -1
  26. package/dist/client/modules/workflow-client.js +44 -0
  27. package/dist/client/modules/workflow-client.js.map +1 -1
  28. package/dist/schemas/board-schemas.d.ts +54 -7
  29. package/dist/schemas/board-schemas.d.ts.map +1 -1
  30. package/dist/schemas/board-schemas.js +35 -13
  31. package/dist/schemas/board-schemas.js.map +1 -1
  32. package/dist/schemas/card-schemas.d.ts +207 -55
  33. package/dist/schemas/card-schemas.d.ts.map +1 -1
  34. package/dist/schemas/card-schemas.js +129 -184
  35. package/dist/schemas/card-schemas.js.map +1 -1
  36. package/dist/schemas/common-schemas.d.ts +6 -0
  37. package/dist/schemas/common-schemas.d.ts.map +1 -1
  38. package/dist/schemas/common-schemas.js +25 -0
  39. package/dist/schemas/common-schemas.js.map +1 -1
  40. package/dist/schemas/custom-field-schemas.js +1 -1
  41. package/dist/schemas/custom-field-schemas.js.map +1 -1
  42. package/dist/schemas/doc-schemas.d.ts +176 -0
  43. package/dist/schemas/doc-schemas.d.ts.map +1 -0
  44. package/dist/schemas/doc-schemas.js +141 -0
  45. package/dist/schemas/doc-schemas.js.map +1 -0
  46. package/dist/schemas/index.d.ts +2 -0
  47. package/dist/schemas/index.d.ts.map +1 -1
  48. package/dist/schemas/index.js +2 -0
  49. package/dist/schemas/index.js.map +1 -1
  50. package/dist/schemas/setup-schemas.d.ts +895 -0
  51. package/dist/schemas/setup-schemas.d.ts.map +1 -0
  52. package/dist/schemas/setup-schemas.js +113 -0
  53. package/dist/schemas/setup-schemas.js.map +1 -0
  54. package/dist/schemas/user-schemas.js +4 -4
  55. package/dist/schemas/user-schemas.js.map +1 -1
  56. package/dist/schemas/utility-schemas.js +2 -2
  57. package/dist/schemas/utility-schemas.js.map +1 -1
  58. package/dist/schemas/workflow-schemas.d.ts +84 -0
  59. package/dist/schemas/workflow-schemas.d.ts.map +1 -1
  60. package/dist/schemas/workflow-schemas.js +44 -2
  61. package/dist/schemas/workflow-schemas.js.map +1 -1
  62. package/dist/schemas/workspace-schemas.d.ts +13 -0
  63. package/dist/schemas/workspace-schemas.d.ts.map +1 -1
  64. package/dist/schemas/workspace-schemas.js +14 -3
  65. package/dist/schemas/workspace-schemas.js.map +1 -1
  66. package/dist/server/mcp-server.d.ts.map +1 -1
  67. package/dist/server/mcp-server.js +3 -1
  68. package/dist/server/mcp-server.js.map +1 -1
  69. package/dist/server/resources/board-resources.js +2 -2
  70. package/dist/server/resources/board-resources.js.map +1 -1
  71. package/dist/server/resources/card-resources.js +2 -2
  72. package/dist/server/resources/card-resources.js.map +1 -1
  73. package/dist/server/resources/workspace-resources.js +1 -1
  74. package/dist/server/resources/workspace-resources.js.map +1 -1
  75. package/dist/server/tools/base-tool.d.ts +34 -0
  76. package/dist/server/tools/base-tool.d.ts.map +1 -1
  77. package/dist/server/tools/base-tool.js +49 -0
  78. package/dist/server/tools/base-tool.js.map +1 -1
  79. package/dist/server/tools/board-tools.d.ts +0 -11
  80. package/dist/server/tools/board-tools.d.ts.map +1 -1
  81. package/dist/server/tools/board-tools.js +166 -214
  82. package/dist/server/tools/board-tools.js.map +1 -1
  83. package/dist/server/tools/card-tools.d.ts +6 -36
  84. package/dist/server/tools/card-tools.d.ts.map +1 -1
  85. package/dist/server/tools/card-tools.js +464 -593
  86. package/dist/server/tools/card-tools.js.map +1 -1
  87. package/dist/server/tools/custom-field-tools.d.ts +1 -2
  88. package/dist/server/tools/custom-field-tools.d.ts.map +1 -1
  89. package/dist/server/tools/custom-field-tools.js +8 -16
  90. package/dist/server/tools/custom-field-tools.js.map +1 -1
  91. package/dist/server/tools/doc-tools.d.ts +14 -0
  92. package/dist/server/tools/doc-tools.d.ts.map +1 -0
  93. package/dist/server/tools/doc-tools.js +280 -0
  94. package/dist/server/tools/doc-tools.js.map +1 -0
  95. package/dist/server/tools/index.d.ts +2 -0
  96. package/dist/server/tools/index.d.ts.map +1 -1
  97. package/dist/server/tools/index.js +2 -0
  98. package/dist/server/tools/index.js.map +1 -1
  99. package/dist/server/tools/setup-tools.d.ts +21 -0
  100. package/dist/server/tools/setup-tools.d.ts.map +1 -0
  101. package/dist/server/tools/setup-tools.js +224 -0
  102. package/dist/server/tools/setup-tools.js.map +1 -0
  103. package/dist/server/tools/user-tools.d.ts +0 -4
  104. package/dist/server/tools/user-tools.d.ts.map +1 -1
  105. package/dist/server/tools/user-tools.js +35 -65
  106. package/dist/server/tools/user-tools.js.map +1 -1
  107. package/dist/server/tools/utility-tools.d.ts +0 -2
  108. package/dist/server/tools/utility-tools.d.ts.map +1 -1
  109. package/dist/server/tools/utility-tools.js +15 -28
  110. package/dist/server/tools/utility-tools.js.map +1 -1
  111. package/dist/server/tools/workflow-tools.d.ts +0 -2
  112. package/dist/server/tools/workflow-tools.d.ts.map +1 -1
  113. package/dist/server/tools/workflow-tools.js +93 -33
  114. package/dist/server/tools/workflow-tools.js.map +1 -1
  115. package/dist/server/tools/workspace-tools.d.ts +0 -3
  116. package/dist/server/tools/workspace-tools.d.ts.map +1 -1
  117. package/dist/server/tools/workspace-tools.js +36 -49
  118. package/dist/server/tools/workspace-tools.js.map +1 -1
  119. package/dist/types/card.d.ts +31 -0
  120. package/dist/types/card.d.ts.map +1 -1
  121. package/dist/types/doc.d.ts +96 -0
  122. package/dist/types/doc.d.ts.map +1 -0
  123. package/dist/types/doc.js +3 -0
  124. package/dist/types/doc.js.map +1 -0
  125. package/dist/types/index.d.ts +1 -0
  126. package/dist/types/index.d.ts.map +1 -1
  127. package/dist/types/index.js +1 -0
  128. package/dist/types/index.js.map +1 -1
  129. package/dist/types/lane.d.ts +9 -1
  130. package/dist/types/lane.d.ts.map +1 -1
  131. package/dist/types/workflow.d.ts +24 -0
  132. package/dist/types/workflow.d.ts.map +1 -1
  133. package/dist/types/workspace.d.ts +1 -0
  134. package/dist/types/workspace.d.ts.map +1 -1
  135. package/docs/TOOLS.md +61 -14
  136. package/package.json +8 -2
@@ -0,0 +1,224 @@
1
+ import { configureBoardStructureSchema, createBoardsInWorkspaceSchema, createWorkspacesAndBoardsSchema, } from '../../schemas/index.js';
2
+ import { logger } from '../../utils/logger.js';
3
+ import { WRITE, registerTool } from './base-tool.js';
4
+ export class SetupToolHandler {
5
+ registerTools(server, client, readOnlyMode) {
6
+ if (readOnlyMode) {
7
+ return;
8
+ }
9
+ registerTool(server, {
10
+ name: 'create_workspaces_and_boards',
11
+ title: 'Create Workspaces and Boards',
12
+ description: 'Create one or more workspaces (max 3) together with their boards and full board structure (workflows, renamed default columns, extra columns and lanes) in a single batch call',
13
+ schema: createWorkspacesAndBoardsSchema,
14
+ annotations: WRITE,
15
+ errorContext: 'creating workspaces and boards',
16
+ handler: async ({ workspaces }) => {
17
+ const reports = [];
18
+ for (const workspaceConfig of workspaces) {
19
+ reports.push(await this.createWorkspaceWithBoards(client, workspaceConfig));
20
+ }
21
+ return { workspaces: reports };
22
+ },
23
+ });
24
+ registerTool(server, {
25
+ name: 'create_boards_in_workspace',
26
+ title: 'Create Boards in Workspace',
27
+ description: 'Create one or more boards (max 3) with their full structure (workflows, renamed default columns, extra columns and lanes) in an existing workspace, in a single batch call',
28
+ schema: createBoardsInWorkspaceSchema,
29
+ annotations: WRITE,
30
+ errorContext: 'creating boards in workspace',
31
+ handler: async ({ workspace_id, boards }) => {
32
+ const reports = await this.createBoardsWithStructure(client, workspace_id, boards);
33
+ return { workspace_id, boards: reports };
34
+ },
35
+ });
36
+ registerTool(server, {
37
+ name: 'configure_board_structure',
38
+ title: 'Configure Board Structure',
39
+ description: 'Configure the structure of an existing board in a single batch call: create or rename workflows, rename the built-in Requested/In Progress/Done columns, and add extra columns and lanes',
40
+ schema: configureBoardStructureSchema,
41
+ annotations: WRITE,
42
+ errorContext: 'configuring board structure',
43
+ handler: async ({ board_id, workflows }) => {
44
+ const reports = [];
45
+ for (const workflowConfig of workflows) {
46
+ reports.push(await this.applyWorkflowConfig(client, board_id, workflowConfig));
47
+ }
48
+ return { board_id, workflows: reports };
49
+ },
50
+ });
51
+ }
52
+ async createWorkspaceWithBoards(client, workspaceConfig) {
53
+ const report = { name: workspaceConfig.name, boards: [] };
54
+ try {
55
+ const workspace = await client.workspaces.createWorkspace({
56
+ name: workspaceConfig.name,
57
+ ...(workspaceConfig.type !== undefined && { type: workspaceConfig.type }),
58
+ });
59
+ if (workspace.workspace_id === undefined) {
60
+ throw new Error('Workspace was created but the API did not return a workspace_id');
61
+ }
62
+ report.workspace_id = workspace.workspace_id;
63
+ report.boards = await this.createBoardsWithStructure(client, workspace.workspace_id, workspaceConfig.boards ?? []);
64
+ }
65
+ catch (error) {
66
+ report.error = errorMessage(error);
67
+ }
68
+ return report;
69
+ }
70
+ async createBoardsWithStructure(client, workspaceId, boards) {
71
+ const reports = [];
72
+ for (const boardConfig of boards) {
73
+ const report = { name: boardConfig.name, workflows: [] };
74
+ try {
75
+ const board = await client.boards.createBoard({
76
+ name: boardConfig.name,
77
+ workspace_id: workspaceId,
78
+ ...(boardConfig.description && { description: boardConfig.description }),
79
+ });
80
+ if (board.board_id === undefined) {
81
+ throw new Error('Board was created but the API did not return a board_id');
82
+ }
83
+ report.board_id = board.board_id;
84
+ for (const workflowConfig of boardConfig.workflows ?? []) {
85
+ report.workflows.push(await this.applyWorkflowConfig(client, board.board_id, workflowConfig));
86
+ }
87
+ }
88
+ catch (error) {
89
+ report.error = errorMessage(error);
90
+ }
91
+ reports.push(report);
92
+ }
93
+ return reports;
94
+ }
95
+ async applyWorkflowConfig(client, boardId, config) {
96
+ const report = {
97
+ created: false,
98
+ renamed_default_columns: [],
99
+ created_columns: [],
100
+ created_lanes: [],
101
+ errors: [],
102
+ };
103
+ const workflowId = await this.resolveWorkflow(client, boardId, config, report);
104
+ if (workflowId === undefined) {
105
+ return report;
106
+ }
107
+ const columnIdsByName = await this.renameDefaultColumns(client, boardId, workflowId, config, report);
108
+ await this.createColumns(client, boardId, workflowId, config, columnIdsByName, report);
109
+ await this.createLanes(client, boardId, workflowId, config, report);
110
+ if (report.errors.length > 0) {
111
+ logger.warn(`Board ${boardId} structure setup finished with ${report.errors.length} error(s)`);
112
+ }
113
+ return report;
114
+ }
115
+ /** Resolve the target workflow: create a new one or rename an existing one */
116
+ async resolveWorkflow(client, boardId, config, report) {
117
+ let workflowId = config.workflow_id;
118
+ try {
119
+ if (workflowId === undefined) {
120
+ if (config.type === undefined) {
121
+ report.errors.push('Provide workflow_id (existing) or type (to create a new workflow).');
122
+ return undefined;
123
+ }
124
+ const workflow = await client.workflows.createWorkflow(boardId, {
125
+ type: config.type,
126
+ ...(config.name && { name: config.name }),
127
+ });
128
+ workflowId = workflow.workflow_id;
129
+ report.created = true;
130
+ }
131
+ else if (config.name) {
132
+ await client.workflows.updateWorkflow(boardId, workflowId, { name: config.name });
133
+ }
134
+ report.workflow_id = workflowId;
135
+ return workflowId;
136
+ }
137
+ catch (error) {
138
+ report.errors.push(`workflow: ${errorMessage(error)}`);
139
+ return undefined;
140
+ }
141
+ }
142
+ /**
143
+ * Rename the built-in section columns and return a name -> column_id map of the
144
+ * workflow's existing columns (used for parent resolution when creating sub-columns)
145
+ */
146
+ async renameDefaultColumns(client, boardId, workflowId, config, report) {
147
+ const columnIdsByName = new Map();
148
+ if (!config.default_columns?.length && !config.columns?.some((c) => c.parent_column_name)) {
149
+ return columnIdsByName;
150
+ }
151
+ try {
152
+ const structure = await client.boards.getCurrentBoardStructure(boardId);
153
+ for (const [columnId, column] of Object.entries(structure.columns)) {
154
+ if (column.workflow_id !== workflowId) {
155
+ continue;
156
+ }
157
+ columnIdsByName.set(column.name, Number(columnId));
158
+ // Rename built-in columns by section (top-level columns only)
159
+ const rename = config.default_columns?.find((dc) => dc.section === column.section && !column.parent_column_id);
160
+ if (rename && !report.renamed_default_columns.includes(rename.name)) {
161
+ await client.boards.updateColumn(boardId, Number(columnId), { name: rename.name });
162
+ columnIdsByName.delete(column.name);
163
+ columnIdsByName.set(rename.name, Number(columnId));
164
+ report.renamed_default_columns.push(rename.name);
165
+ }
166
+ }
167
+ }
168
+ catch (error) {
169
+ report.errors.push(`default_columns: ${errorMessage(error)}`);
170
+ }
171
+ return columnIdsByName;
172
+ }
173
+ /** Create the extra columns (main or sub-columns resolved by parent name) */
174
+ async createColumns(client, boardId, workflowId, config, columnIdsByName, report) {
175
+ for (const column of config.columns ?? []) {
176
+ try {
177
+ const parentColumnId = column.parent_column_name
178
+ ? columnIdsByName.get(column.parent_column_name)
179
+ : undefined;
180
+ if (column.parent_column_name && parentColumnId === undefined) {
181
+ report.errors.push(`column "${column.name}": parent column "${column.parent_column_name}" not found`);
182
+ continue;
183
+ }
184
+ const sharedFields = {
185
+ position: column.position ?? 0,
186
+ name: column.name,
187
+ ...(column.limit !== undefined && { limit: column.limit }),
188
+ ...(column.description && { description: column.description }),
189
+ };
190
+ const created = await client.boards.createColumn(boardId, parentColumnId !== undefined
191
+ ? { parent_column_id: parentColumnId, ...sharedFields }
192
+ : { workflow_id: workflowId, section: column.section ?? 3, ...sharedFields });
193
+ if (created.column_id !== undefined) {
194
+ columnIdsByName.set(column.name, created.column_id);
195
+ }
196
+ report.created_columns.push(column.name);
197
+ }
198
+ catch (error) {
199
+ report.errors.push(`column "${column.name}": ${errorMessage(error)}`);
200
+ }
201
+ }
202
+ }
203
+ /** Create the extra lanes */
204
+ async createLanes(client, boardId, workflowId, config, report) {
205
+ for (const lane of config.lanes ?? []) {
206
+ try {
207
+ await client.boards.createLane(boardId, {
208
+ workflow_id: workflowId,
209
+ position: lane.position ?? 0,
210
+ name: lane.name,
211
+ ...(lane.color && { color: lane.color }),
212
+ });
213
+ report.created_lanes.push(lane.name);
214
+ }
215
+ catch (error) {
216
+ report.errors.push(`lane "${lane.name}": ${errorMessage(error)}`);
217
+ }
218
+ }
219
+ }
220
+ }
221
+ function errorMessage(error) {
222
+ return error instanceof Error ? error.message : 'Unknown error';
223
+ }
224
+ //# sourceMappingURL=setup-tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup-tools.js","sourceRoot":"","sources":["../../../src/server/tools/setup-tools.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,6BAA6B,EAC7B,6BAA6B,EAC7B,+BAA+B,GAGhC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAmB,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AA4BtE,MAAM,OAAO,gBAAgB;IAC3B,aAAa,CAAC,MAAiB,EAAE,MAAyB,EAAE,YAAqB;QAC/E,IAAI,YAAY,EAAE,CAAC;YACjB,OAAO;QACT,CAAC;QAED,YAAY,CAAC,MA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C;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,MAAM,CAAC,IAAI,MAAM,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YACxE,CAAC;QACH,CAAC;IACH,CAAC;IAED,6BAA6B;IACrB,KAAK,CAAC,WAAW,CACvB,MAAyB,EACzB,OAAe,EACf,UAAkB,EAClB,MAA2B,EAC3B,MAA2B;QAE3B,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,KAAK,IAAI,EAAE,EAAE,CAAC;YACtC,IAAI,CAAC;gBACH,MAAM,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE;oBACtC,WAAW,EAAE,UAAU;oBACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,CAAC;oBAC5B,IAAI,EAAE,IAAI,CAAC,IAAI;oBACf,GAAG,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;iBACzC,CAAC,CAAC;gBACH,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACvC,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,IAAI,CAAC,IAAI,MAAM,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YACpE,CAAC;QACH,CAAC;IACH,CAAC;CACF;AAED,SAAS,YAAY,CAAC,KAAc;IAClC,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;AAClE,CAAC"}
@@ -3,9 +3,5 @@ import { BusinessMapClient } from '../../client/businessmap-client.js';
3
3
  import { BaseToolHandler } from './base-tool.js';
4
4
  export declare class UserToolHandler implements BaseToolHandler {
5
5
  registerTools(server: McpServer, client: BusinessMapClient, readOnlyMode: boolean): void;
6
- private registerListUsers;
7
- private registerGetUser;
8
- private registerGetCurrentUser;
9
- private registerInviteUser;
10
6
  }
11
7
  //# sourceMappingURL=user-tools.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"user-tools.d.ts","sourceRoot":"","sources":["../../../src/server/tools/user-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAOvE,OAAO,EAAE,eAAe,EAA8C,MAAM,gBAAgB,CAAC;AAE7F,qBAAa,eAAgB,YAAW,eAAe;IACrD,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,iBAAiB,EAAE,YAAY,EAAE,OAAO,GAAG,IAAI;IAUxF,OAAO,CAAC,iBAAiB;IAoBzB,OAAO,CAAC,eAAe;IAoBvB,OAAO,CAAC,sBAAsB;IAoB9B,OAAO,CAAC,kBAAkB;CAuB3B"}
1
+ {"version":3,"file":"user-tools.d.ts","sourceRoot":"","sources":["../../../src/server/tools/user-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAOvE,OAAO,EAAE,eAAe,EAA2B,MAAM,gBAAgB,CAAC;AAE1E,qBAAa,eAAgB,YAAW,eAAe;IACrD,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,iBAAiB,EAAE,YAAY,EAAE,OAAO,GAAG,IAAI;CAkDzF"}
@@ -1,80 +1,50 @@
1
1
  import { getCurrentUserSchema, getUserSchema, inviteUserSchema, listUsersSchema, } from '../../schemas/user-schemas.js';
2
- import { createErrorResponse, createSuccessResponse } from './base-tool.js';
2
+ import { READ_ONLY, registerTool } from './base-tool.js';
3
3
  export class UserToolHandler {
4
4
  registerTools(server, client, readOnlyMode) {
5
- this.registerListUsers(server, client);
6
- this.registerGetUser(server, client);
7
- this.registerGetCurrentUser(server, client);
8
- if (!readOnlyMode) {
9
- this.registerInviteUser(server, client);
10
- }
11
- }
12
- registerListUsers(server, client) {
13
- server.registerTool('list_users', {
5
+ registerTool(server, {
6
+ name: 'list_users',
14
7
  title: 'List Users',
15
8
  description: 'Get a list of all users',
16
- inputSchema: listUsersSchema.shape,
17
- annotations: { readOnlyHint: true, idempotentHint: true },
18
- }, async () => {
19
- try {
20
- const users = await client.getUsers();
21
- return createSuccessResponse(users);
22
- }
23
- catch (error) {
24
- return createErrorResponse(error, 'fetching users');
25
- }
9
+ schema: listUsersSchema,
10
+ annotations: READ_ONLY,
11
+ errorContext: 'fetching users',
12
+ handler: () => client.users.getUsers(),
26
13
  });
27
- }
28
- registerGetUser(server, client) {
29
- server.registerTool('get_user', {
14
+ registerTool(server, {
15
+ name: 'get_user',
30
16
  title: 'Get User',
31
17
  description: 'Get details of a specific user',
32
- inputSchema: getUserSchema.shape,
33
- annotations: { readOnlyHint: true, idempotentHint: true },
34
- }, async ({ user_id }) => {
35
- try {
36
- const user = await client.getUser(user_id);
37
- return createSuccessResponse(user);
38
- }
39
- catch (error) {
40
- return createErrorResponse(error, 'fetching user');
41
- }
18
+ schema: getUserSchema,
19
+ annotations: READ_ONLY,
20
+ errorContext: 'fetching user',
21
+ handler: ({ user_id }) => client.users.getUser(user_id),
42
22
  });
43
- }
44
- registerGetCurrentUser(server, client) {
45
- server.registerTool('get_current_user', {
23
+ registerTool(server, {
24
+ name: 'get_current_user',
46
25
  title: 'Get Current User',
47
26
  description: 'Get details of the current logged user',
48
- inputSchema: getCurrentUserSchema.shape,
49
- annotations: { readOnlyHint: true, idempotentHint: true },
50
- }, async () => {
51
- try {
52
- const currentUser = await client.getCurrentUser();
53
- return createSuccessResponse(currentUser);
54
- }
55
- catch (error) {
56
- return createErrorResponse(error, 'fetching current user');
57
- }
58
- });
59
- }
60
- registerInviteUser(server, client) {
61
- server.registerTool('invite_user', {
62
- title: 'Invite User',
63
- description: 'Add and invite a new user by email. Sends an invitation email with a link to set their password and log in.',
64
- inputSchema: inviteUserSchema.shape,
65
- }, async ({ email, do_not_send_confirmation_email }) => {
66
- try {
67
- const params = { email };
68
- if (do_not_send_confirmation_email !== undefined) {
69
- params['do_not_send_confirmation_email'] = do_not_send_confirmation_email;
70
- }
71
- const user = await client.inviteUser(params);
72
- return createSuccessResponse(user, 'User invited successfully:');
73
- }
74
- catch (error) {
75
- return createErrorResponse(error, 'inviting user');
76
- }
27
+ schema: getCurrentUserSchema,
28
+ annotations: READ_ONLY,
29
+ errorContext: 'fetching current user',
30
+ handler: () => client.users.getCurrentUser(),
77
31
  });
32
+ if (!readOnlyMode) {
33
+ registerTool(server, {
34
+ name: 'invite_user',
35
+ title: 'Invite User',
36
+ description: 'Add and invite a new user by email. Sends an invitation email with a link to set their password and log in.',
37
+ schema: inviteUserSchema,
38
+ errorContext: 'inviting user',
39
+ successMessage: 'User invited successfully:',
40
+ handler: ({ email, do_not_send_confirmation_email }) => client.users.inviteUser({
41
+ email,
42
+ ...(do_not_send_confirmation_email !== undefined && {
43
+ do_not_send_confirmation_email,
44
+ }),
45
+ }),
46
+ });
47
+ }
78
48
  }
79
49
  }
80
50
  //# sourceMappingURL=user-tools.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"user-tools.js","sourceRoot":"","sources":["../../../src/server/tools/user-tools.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,oBAAoB,EACpB,aAAa,EACb,gBAAgB,EAChB,eAAe,GAChB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAmB,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAE7F,MAAM,OAAO,eAAe;IAC1B,aAAa,CAAC,MAAiB,EAAE,MAAyB,EAAE,YAAqB;QAC/E,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACvC,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC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AAE;SAC7C,CAAC,CAAC;QAEH,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,YAAY,CAAC,MAAM,EAAE;gBACnB,IAAI,EAAE,aAAa;gBACnB,KAAK,EAAE,aAAa;gBACpB,WAAW,EACT,6GAA6G;gBAC/G,MAAM,EAAE,gBAAgB;gBACxB,YAAY,EAAE,eAAe;gBAC7B,cAAc,EAAE,4BAA4B;gBAC5C,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,8BAA8B,EAAE,EAAE,EAAE,CACrD,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC;oBACtB,KAAK;oBACL,GAAG,CAAC,8BAA8B,KAAK,SAAS,IAAI;wBAClD,8BAA8B;qBAC/B,CAAC;iBACH,CAAC;aACL,CAAC,CAAC;QACL,CAAC;IACH,CAAC;CACF"}
@@ -3,7 +3,5 @@ import { BusinessMapClient } from '../../client/businessmap-client.js';
3
3
  import { BaseToolHandler } from './base-tool.js';
4
4
  export declare class UtilityToolHandler implements BaseToolHandler {
5
5
  registerTools(server: McpServer, client: BusinessMapClient): void;
6
- private registerHealthCheck;
7
- private registerGetApiInfo;
8
6
  }
9
7
  //# sourceMappingURL=utility-tools.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utility-tools.d.ts","sourceRoot":"","sources":["../../../src/server/tools/utility-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAEvE,OAAO,EAAE,eAAe,EAA8C,MAAM,gBAAgB,CAAC;AAE7F,qBAAa,kBAAmB,YAAW,eAAe;IACxD,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,iBAAiB,GAAG,IAAI;IAKjE,OAAO,CAAC,mBAAmB;IA2B3B,OAAO,CAAC,kBAAkB;CAoB3B"}
1
+ {"version":3,"file":"utility-tools.d.ts","sourceRoot":"","sources":["../../../src/server/tools/utility-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAEvE,OAAO,EAAE,eAAe,EAA2B,MAAM,gBAAgB,CAAC;AAE1E,qBAAa,kBAAmB,YAAW,eAAe;IACxD,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,iBAAiB,GAAG,IAAI;CA+BlE"}
@@ -1,19 +1,16 @@
1
1
  import { getApiInfoSchema, healthCheckSchema } from '../../schemas/utility-schemas.js';
2
- import { createErrorResponse, createSuccessResponse } from './base-tool.js';
2
+ import { READ_ONLY, registerTool } from './base-tool.js';
3
3
  export class UtilityToolHandler {
4
4
  registerTools(server, client) {
5
- this.registerHealthCheck(server, client);
6
- this.registerGetApiInfo(server, client);
7
- }
8
- registerHealthCheck(server, client) {
9
- server.registerTool('health_check', {
5
+ registerTool(server, {
6
+ name: 'health_check',
10
7
  title: 'Health Check',
11
8
  description: 'Check the connection to BusinessMap API',
12
- inputSchema: healthCheckSchema.shape,
13
- annotations: { readOnlyHint: true, idempotentHint: true },
14
- }, async () => {
15
- try {
16
- const isHealthy = await client.healthCheck();
9
+ schema: healthCheckSchema,
10
+ annotations: READ_ONLY,
11
+ errorContext: 'health check failed',
12
+ handler: async () => {
13
+ const isHealthy = await client.utility.healthCheck();
17
14
  return {
18
15
  content: [
19
16
  {
@@ -22,26 +19,16 @@ export class UtilityToolHandler {
22
19
  },
23
20
  ],
24
21
  };
25
- }
26
- catch (error) {
27
- return createErrorResponse(error, 'health check failed');
28
- }
22
+ },
29
23
  });
30
- }
31
- registerGetApiInfo(server, client) {
32
- server.registerTool('get_api_info', {
24
+ registerTool(server, {
25
+ name: 'get_api_info',
33
26
  title: 'Get API Info',
34
27
  description: 'Get information about the BusinessMap API',
35
- inputSchema: getApiInfoSchema.shape,
36
- annotations: { readOnlyHint: true, idempotentHint: true },
37
- }, async () => {
38
- try {
39
- const apiInfo = await client.getApiInfo();
40
- return createSuccessResponse(apiInfo);
41
- }
42
- catch (error) {
43
- return createErrorResponse(error, 'fetching API info');
44
- }
28
+ schema: getApiInfoSchema,
29
+ annotations: READ_ONLY,
30
+ errorContext: 'fetching API info',
31
+ handler: () => client.utility.getApiInfo(),
45
32
  });
46
33
  }
47
34
  }
@@ -1 +1 @@
1
- {"version":3,"file":"utility-tools.js","sourceRoot":"","sources":["../../../src/server/tools/utility-tools.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACvF,OAAO,EAAmB,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAE7F,MAAM,OAAO,kBAAkB;IAC7B,aAAa,CAAC,MAAiB,EAAE,MAAyB;QACxD,IAAI,CAAC,mBAAmB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACzC,IAAI,CAAC,kBAAkB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,CAAC;IAEO,mBAAmB,CAAC,MAAiB,EAAE,MAAyB;QACtE,MAAM,CAAC,YAAY,CACjB,cAAc,EACd;YACE,KAAK,EAAE,cAAc;YACrB,WAAW,EAAE,yCAAyC;YACtD,WAAW,EAAE,iBAAiB,CAAC,KAAK;YACpC,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE;SAC1D,EACD,KAAK,IAAI,EAAE;YACT,IAAI,CAAC;gBACH,MAAM,SAAS,GAAG,MAAM,MAAM,CAAC,WAAW,EAAE,CAAC;gBAC7C,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAe;4BACrB,IAAI,EAAE,2BAA2B,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,EAAE;yBACvE;qBACF;iBACF,CAAC;YACJ,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,mBAAmB,CAAC,KAAK,EAAE,qBAAqB,CAAC,CAAC;YAC3D,CAAC;QACH,CAAC,CACF,CAAC;IACJ,CAAC;IAEO,kBAAkB,CAAC,MAAiB,EAAE,MAAyB;QACrE,MAAM,CAAC,YAAY,CACjB,cAAc,EACd;YACE,KAAK,EAAE,cAAc;YACrB,WAAW,EACT,2CAA2C;YAC7C,WAAW,EAAE,gBAAgB,CAAC,KAAK;YACnC,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE;SAC1D,EACD,KAAK,IAAI,EAAE;YACT,IAAI,CAAC;gBACH,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,UAAU,EAAE,CAAC;gBAC1C,OAAO,qBAAqB,CAAC,OAAO,CAAC,CAAC;YACxC,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,mBAAmB,CAAC,KAAK,EAAE,mBAAmB,CAAC,CAAC;YACzD,CAAC;QACH,CAAC,CACF,CAAC;IACJ,CAAC;CACF"}
1
+ {"version":3,"file":"utility-tools.js","sourceRoot":"","sources":["../../../src/server/tools/utility-tools.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACvF,OAAO,EAAmB,SAAS,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE1E,MAAM,OAAO,kBAAkB;IAC7B,aAAa,CAAC,MAAiB,EAAE,MAAyB;QACxD,YAAY,CAAC,MAAM,EAAE;YACnB,IAAI,EAAE,cAAc;YACpB,KAAK,EAAE,cAAc;YACrB,WAAW,EAAE,yCAAyC;YACtD,MAAM,EAAE,iBAAiB;YACzB,WAAW,EAAE,SAAS;YACtB,YAAY,EAAE,qBAAqB;YACnC,OAAO,EAAE,KAAK,IAAI,EAAE;gBAClB,MAAM,SAAS,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;gBACrD,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAe;4BACrB,IAAI,EAAE,2BAA2B,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,EAAE;yBACvE;qBACF;iBACF,CAAC;YACJ,CAAC;SACF,CAAC,CAAC;QAEH,YAAY,CAAC,MAAM,EAAE;YACnB,IAAI,EAAE,cAAc;YACpB,KAAK,EAAE,cAAc;YACrB,WAAW,EAAE,2CAA2C;YACxD,MAAM,EAAE,gBAAgB;YACxB,WAAW,EAAE,SAAS;YACtB,YAAY,EAAE,mBAAmB;YACjC,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,UAAU,EAAE;SAC3C,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -3,7 +3,5 @@ import { BusinessMapClient } from '../../client/businessmap-client.js';
3
3
  import { BaseToolHandler } from './base-tool.js';
4
4
  export declare class WorkflowToolHandler implements BaseToolHandler {
5
5
  registerTools(server: McpServer, client: BusinessMapClient, readOnlyMode: boolean): void;
6
- private registerGetWorkflowCycleTimeColumns;
7
- private registerGetWorkflowEffectiveCycleTimeColumns;
8
6
  }
9
7
  //# sourceMappingURL=workflow-tools.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"workflow-tools.d.ts","sourceRoot":"","sources":["../../../src/server/tools/workflow-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAMvE,OAAO,EAAE,eAAe,EAA8C,MAAM,gBAAgB,CAAC;AAE7F,qBAAa,mBAAoB,YAAW,eAAe;IACzD,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,iBAAiB,EAAE,YAAY,EAAE,OAAO,GAAG,IAAI;IAKxF,OAAO,CAAC,mCAAmC;IAoB3C,OAAO,CAAC,4CAA4C;CA+BrD"}
1
+ {"version":3,"file":"workflow-tools.d.ts","sourceRoot":"","sources":["../../../src/server/tools/workflow-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAWvE,OAAO,EACL,eAAe,EAMhB,MAAM,gBAAgB,CAAC;AAExB,qBAAa,mBAAoB,YAAW,eAAe;IACzD,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,iBAAiB,EAAE,YAAY,EAAE,OAAO,GAAG,IAAI;CAoHzF"}
@@ -1,45 +1,105 @@
1
- import { getWorkflowCycleTimeColumnsSchema, getWorkflowEffectiveCycleTimeColumnsSchema, } from '../../schemas/workflow-schemas.js';
2
- import { logger } from '../../utils/logger.js';
3
- import { createErrorResponse, createSuccessResponse } from './base-tool.js';
1
+ import { createWorkflowSchema, getWorkflowCycleTimeColumnsSchema, getWorkflowEffectiveCycleTimeColumnsSchema, getWorkflowSchema, linkRelatedWorkflowSchema, listWorkflowsSchema, unlinkRelatedWorkflowSchema, updateWorkflowSchema, } from '../../schemas/workflow-schemas.js';
2
+ import { READ_ONLY, WRITE, WRITE_IDEMPOTENT, createSuccessResponse, registerTool, } from './base-tool.js';
4
3
  export class WorkflowToolHandler {
5
4
  registerTools(server, client, readOnlyMode) {
6
- this.registerGetWorkflowCycleTimeColumns(server, client);
7
- this.registerGetWorkflowEffectiveCycleTimeColumns(server, client);
8
- }
9
- registerGetWorkflowCycleTimeColumns(server, client) {
10
- server.registerTool('get_workflow_cycle_time_columns', {
5
+ registerTool(server, {
6
+ name: 'get_workflow_cycle_time_columns',
11
7
  title: 'Get Workflow Cycle Time Columns',
12
8
  description: "Get workflow's cycle time columns",
13
- inputSchema: getWorkflowCycleTimeColumnsSchema.shape,
14
- annotations: { readOnlyHint: true, idempotentHint: true },
15
- }, async ({ board_id, workflow_id }) => {
16
- try {
17
- const columns = await client.getWorkflowCycleTimeColumns(board_id, workflow_id);
18
- return createSuccessResponse(columns);
19
- }
20
- catch (error) {
21
- return createErrorResponse(error, 'fetching workflow cycle time columns');
22
- }
9
+ schema: getWorkflowCycleTimeColumnsSchema,
10
+ annotations: READ_ONLY,
11
+ errorContext: 'fetching workflow cycle time columns',
12
+ handler: ({ board_id, workflow_id }) => client.workflows.getWorkflowCycleTimeColumns(board_id, workflow_id),
23
13
  });
24
- }
25
- registerGetWorkflowEffectiveCycleTimeColumns(server, client) {
26
- server.registerTool('get_workflow_effective_cycle_time_columns', {
14
+ registerTool(server, {
15
+ name: 'get_workflow_effective_cycle_time_columns',
27
16
  title: 'Get Workflow Effective Cycle Time Columns',
28
17
  description: "Get workflow's effective cycle time columns (the columns actually used for cycle time calculation with applied filters/logic)",
29
- inputSchema: getWorkflowEffectiveCycleTimeColumnsSchema.shape,
30
- annotations: { readOnlyHint: true, idempotentHint: true },
31
- }, async ({ board_id, workflow_id }) => {
32
- try {
33
- logger.debug(`Fetching effective cycle time columns for board ${board_id}, workflow ${workflow_id}`);
34
- const columns = await client.getWorkflowEffectiveCycleTimeColumns(board_id, workflow_id);
35
- logger.debug(`Received ${columns.length} effective cycle time columns`);
18
+ schema: getWorkflowEffectiveCycleTimeColumnsSchema,
19
+ annotations: READ_ONLY,
20
+ errorContext: 'fetching workflow effective cycle time columns',
21
+ handler: async ({ board_id, workflow_id }) => {
22
+ const columns = await client.workflows.getWorkflowEffectiveCycleTimeColumns(board_id, workflow_id);
36
23
  return createSuccessResponse(columns, `Retrieved ${columns.length} effective cycle time columns for board ${board_id}, workflow ${workflow_id}`);
37
- }
38
- catch (error) {
39
- logger.error(`Error fetching effective cycle time columns:`, error);
40
- return createErrorResponse(error, 'fetching workflow effective cycle time columns');
41
- }
24
+ },
25
+ });
26
+ registerTool(server, {
27
+ name: 'list_workflows',
28
+ title: 'List Workflows',
29
+ description: 'Get a list of workflows for the specified board',
30
+ schema: listWorkflowsSchema,
31
+ annotations: READ_ONLY,
32
+ errorContext: 'fetching workflows',
33
+ handler: ({ board_id }) => client.workflows.getWorkflows(board_id),
34
+ });
35
+ registerTool(server, {
36
+ name: 'get_workflow',
37
+ title: 'Get Workflow',
38
+ description: 'Get the details of a workflow for the specified board',
39
+ schema: getWorkflowSchema,
40
+ annotations: READ_ONLY,
41
+ errorContext: 'fetching workflow',
42
+ handler: ({ board_id, workflow_id }) => client.workflows.getWorkflow(board_id, workflow_id),
42
43
  });
44
+ if (!readOnlyMode) {
45
+ registerTool(server, {
46
+ name: 'create_workflow',
47
+ title: 'Create Workflow',
48
+ description: 'Create a new workflow on a board. Type: 0=cards, 1=initiatives, 2=timeline. Default names apply by type when name is omitted.',
49
+ schema: createWorkflowSchema,
50
+ annotations: WRITE,
51
+ errorContext: 'creating workflow',
52
+ successMessage: 'Workflow created successfully:',
53
+ handler: ({ board_id, type, name, position, is_enabled, is_collapsible }) => client.workflows.createWorkflow(board_id, {
54
+ type,
55
+ ...(name !== undefined && { name }),
56
+ ...(position !== undefined && { position }),
57
+ ...(is_enabled !== undefined && { is_enabled }),
58
+ ...(is_collapsible !== undefined && { is_collapsible }),
59
+ }),
60
+ });
61
+ registerTool(server, {
62
+ name: 'update_workflow',
63
+ title: 'Update Workflow',
64
+ description: 'Update an existing workflow (name, position, enabled/collapsible state)',
65
+ schema: updateWorkflowSchema,
66
+ annotations: WRITE_IDEMPOTENT,
67
+ errorContext: 'updating workflow',
68
+ successMessage: 'Workflow updated successfully:',
69
+ handler: ({ board_id, workflow_id, name, position, is_enabled, is_collapsible }) => client.workflows.updateWorkflow(board_id, workflow_id, {
70
+ ...(name !== undefined && { name }),
71
+ ...(position !== undefined && { position }),
72
+ ...(is_enabled !== undefined && { is_enabled }),
73
+ ...(is_collapsible !== undefined && { is_collapsible }),
74
+ }),
75
+ });
76
+ registerTool(server, {
77
+ name: 'link_related_workflow',
78
+ title: 'Link Related Workflow',
79
+ description: 'Link a workflow from another board to a target board as a related workflow. You must be a workspace manager of both boards.',
80
+ schema: linkRelatedWorkflowSchema,
81
+ annotations: WRITE_IDEMPOTENT,
82
+ errorContext: 'linking related workflow',
83
+ successMessage: 'Related workflow linked successfully:',
84
+ handler: async ({ board_id, workflow_id, position }) => {
85
+ await client.workflows.linkRelatedWorkflow(board_id, workflow_id, position);
86
+ return { board_id, workflow_id };
87
+ },
88
+ });
89
+ registerTool(server, {
90
+ name: 'unlink_related_workflow',
91
+ title: 'Unlink Related Workflow',
92
+ description: 'Remove a related workflow from a board',
93
+ schema: unlinkRelatedWorkflowSchema,
94
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true },
95
+ errorContext: 'unlinking related workflow',
96
+ successMessage: 'Related workflow unlinked successfully:',
97
+ handler: async ({ board_id, workflow_id }) => {
98
+ await client.workflows.unlinkRelatedWorkflow(board_id, workflow_id);
99
+ return { board_id, workflow_id };
100
+ },
101
+ });
102
+ }
43
103
  }
44
104
  }
45
105
  //# sourceMappingURL=workflow-tools.js.map