@mcp-consultant-tools/powerplatform-data 27.0.0 → 28.0.0-beta.11

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 (61) hide show
  1. package/build/PowerPlatformService.d.ts +2 -0
  2. package/build/PowerPlatformService.d.ts.map +1 -1
  3. package/build/PowerPlatformService.js +6 -0
  4. package/build/PowerPlatformService.js.map +1 -1
  5. package/build/cli/commands/data-commands.d.ts +7 -0
  6. package/build/cli/commands/data-commands.d.ts.map +1 -0
  7. package/build/cli/commands/data-commands.js +185 -0
  8. package/build/cli/commands/data-commands.js.map +1 -0
  9. package/build/cli/commands/flow-commands.d.ts +7 -0
  10. package/build/cli/commands/flow-commands.d.ts.map +1 -0
  11. package/build/cli/commands/flow-commands.js +67 -0
  12. package/build/cli/commands/flow-commands.js.map +1 -0
  13. package/build/cli/commands/index.d.ts +10 -0
  14. package/build/cli/commands/index.d.ts.map +1 -0
  15. package/build/cli/commands/index.js +15 -0
  16. package/build/cli/commands/index.js.map +1 -0
  17. package/build/cli/commands/metadata-commands.d.ts +7 -0
  18. package/build/cli/commands/metadata-commands.d.ts.map +1 -0
  19. package/build/cli/commands/metadata-commands.js +94 -0
  20. package/build/cli/commands/metadata-commands.js.map +1 -0
  21. package/build/cli/output.d.ts +11 -0
  22. package/build/cli/output.d.ts.map +1 -0
  23. package/build/cli/output.js +10 -0
  24. package/build/cli/output.js.map +1 -0
  25. package/build/cli.d.ts +9 -0
  26. package/build/cli.d.ts.map +1 -0
  27. package/build/cli.js +27 -0
  28. package/build/cli.js.map +1 -0
  29. package/build/context-factory.d.ts +8 -0
  30. package/build/context-factory.d.ts.map +1 -0
  31. package/build/context-factory.js +52 -0
  32. package/build/context-factory.js.map +1 -0
  33. package/build/index.d.ts +11 -1
  34. package/build/index.d.ts.map +1 -1
  35. package/build/index.js +45 -557
  36. package/build/index.js.map +1 -1
  37. package/build/services/index.d.ts +5 -0
  38. package/build/services/index.d.ts.map +1 -0
  39. package/build/services/index.js +5 -0
  40. package/build/services/index.js.map +1 -0
  41. package/build/tool-examples.d.ts +34 -0
  42. package/build/tool-examples.d.ts.map +1 -0
  43. package/build/tool-examples.js +41 -0
  44. package/build/tool-examples.js.map +1 -0
  45. package/build/tools/index.d.ts +8 -0
  46. package/build/tools/index.d.ts.map +1 -0
  47. package/build/tools/index.js +11 -0
  48. package/build/tools/index.js.map +1 -0
  49. package/build/tools/read-tools.d.ts +3 -0
  50. package/build/tools/read-tools.d.ts.map +1 -0
  51. package/build/tools/read-tools.js +342 -0
  52. package/build/tools/read-tools.js.map +1 -0
  53. package/build/tools/write-tools.d.ts +3 -0
  54. package/build/tools/write-tools.d.ts.map +1 -0
  55. package/build/tools/write-tools.js +298 -0
  56. package/build/tools/write-tools.js.map +1 -0
  57. package/build/types.d.ts +13 -0
  58. package/build/types.d.ts.map +1 -0
  59. package/build/types.js +2 -0
  60. package/build/types.js.map +1 -0
  61. package/package.json +6 -4
@@ -0,0 +1,298 @@
1
+ /**
2
+ * Write tools for powerplatform-data (6 tools)
3
+ * Require permission flags: POWERPLATFORM_ENABLE_CREATE, _UPDATE, _DELETE, _ACTIONS.
4
+ */
5
+ import { z } from 'zod';
6
+ import { descWithExamples, ENTITY_NAME_EXAMPLES, RECORD_DATA_EXAMPLES, ODATA_BIND_EXAMPLES, NAVIGATION_PROPERTY_EXAMPLES, } from '../tool-examples.js';
7
+ export function registerWriteTools(server, ctx) {
8
+ server.tool("create-record", "Create a new record in Dataverse. Use @odata.bind syntax for lookup fields. Requires POWERPLATFORM_ENABLE_CREATE=true.", {
9
+ entityNamePlural: z
10
+ .string()
11
+ .describe(descWithExamples("The plural entity set name (API name) of the entity", ENTITY_NAME_EXAMPLES)),
12
+ data: z
13
+ .record(z.any())
14
+ .describe(descWithExamples("Record data as JSON object. Field names must match logical names. " +
15
+ "For lookup fields, use '@odata.bind' syntax: {'fieldSchemaName@odata.bind': '/entitysetname(guid)'}. " +
16
+ "For polymorphic lookups, add entity suffix: {'customerid_contact@odata.bind': '/contacts(guid)'}. " +
17
+ "For option sets, use integer values", [...RECORD_DATA_EXAMPLES, ...ODATA_BIND_EXAMPLES])),
18
+ }, async ({ entityNamePlural, data }) => {
19
+ try {
20
+ ctx.checkCreateEnabled();
21
+ const service = ctx.pp;
22
+ const result = await service.createRecord(entityNamePlural, data);
23
+ return {
24
+ content: [
25
+ {
26
+ type: "text",
27
+ text: `✅ Record created successfully in ${entityNamePlural}\n\n` +
28
+ `**Record ID:** ${result.id || result[Object.keys(result).find(k => k.endsWith('id')) || ''] || 'N/A'}\n\n` +
29
+ `**Created Record:**\n\`\`\`json\n${JSON.stringify(result, null, 2)}\n\`\`\``,
30
+ },
31
+ ],
32
+ };
33
+ }
34
+ catch (error) {
35
+ console.error("Error creating record:", error);
36
+ return {
37
+ content: [
38
+ {
39
+ type: "text",
40
+ text: `❌ Failed to create record: ${error.message}`,
41
+ },
42
+ ],
43
+ isError: true,
44
+ };
45
+ }
46
+ });
47
+ server.tool("update-record", "Update an existing record in Dataverse using PATCH (merge). Only include fields being changed; omitted fields are left unchanged. Requires POWERPLATFORM_ENABLE_UPDATE=true.", {
48
+ entityNamePlural: z
49
+ .string()
50
+ .describe(descWithExamples("The plural entity set name (API name) of the entity", ENTITY_NAME_EXAMPLES)),
51
+ recordId: z
52
+ .string()
53
+ .describe("The GUID of the record to update"),
54
+ data: z
55
+ .record(z.any())
56
+ .describe(descWithExamples("Partial record data to update (only fields being changed). " +
57
+ "Field names must match logical names. " +
58
+ "For lookup fields, use '@odata.bind' syntax. " +
59
+ "For option sets, use integer values", [...RECORD_DATA_EXAMPLES, ...ODATA_BIND_EXAMPLES])),
60
+ }, async ({ entityNamePlural, recordId, data }) => {
61
+ try {
62
+ ctx.checkUpdateEnabled();
63
+ const service = ctx.pp;
64
+ const result = await service.updateRecord(entityNamePlural, recordId, data);
65
+ return {
66
+ content: [
67
+ {
68
+ type: "text",
69
+ text: `✅ Record updated successfully in ${entityNamePlural}\n\n` +
70
+ `**Record ID:** ${recordId}\n\n` +
71
+ `**Updated Record:**\n\`\`\`json\n${JSON.stringify(result, null, 2)}\n\`\`\``,
72
+ },
73
+ ],
74
+ };
75
+ }
76
+ catch (error) {
77
+ console.error("Error updating record:", error);
78
+ return {
79
+ content: [
80
+ {
81
+ type: "text",
82
+ text: `❌ Failed to update record: ${error.message}`,
83
+ },
84
+ ],
85
+ isError: true,
86
+ };
87
+ }
88
+ });
89
+ server.tool("delete-record", "Delete a record from Dataverse. Requires POWERPLATFORM_ENABLE_DELETE=true. WARNING: This operation is permanent and cannot be undone.", {
90
+ entityNamePlural: z
91
+ .string()
92
+ .describe(descWithExamples("The plural entity set name (API name) of the entity", ENTITY_NAME_EXAMPLES)),
93
+ recordId: z
94
+ .string()
95
+ .describe("The GUID of the record to delete"),
96
+ confirm: z
97
+ .boolean()
98
+ .optional()
99
+ .describe("Confirmation flag - must be true to proceed with deletion (safety check)"),
100
+ }, async ({ entityNamePlural, recordId, confirm }) => {
101
+ try {
102
+ ctx.checkDeleteEnabled();
103
+ // Require explicit confirmation for deletion
104
+ if (confirm !== true) {
105
+ return {
106
+ content: [
107
+ {
108
+ type: "text",
109
+ text: `⚠️ Delete operation requires explicit confirmation.\n\n` +
110
+ `You are about to delete record **${recordId}** from **${entityNamePlural}**.\n\n` +
111
+ `This operation is **permanent** and **cannot be undone**.\n\n` +
112
+ `To proceed, call this tool again with \`confirm: true\`.`,
113
+ },
114
+ ],
115
+ };
116
+ }
117
+ const service = ctx.pp;
118
+ await service.deleteRecord(entityNamePlural, recordId);
119
+ return {
120
+ content: [
121
+ {
122
+ type: "text",
123
+ text: `✅ Record deleted successfully\n\n` +
124
+ `**Entity:** ${entityNamePlural}\n` +
125
+ `**Record ID:** ${recordId}\n\n` +
126
+ `⚠️ This operation is permanent.`,
127
+ },
128
+ ],
129
+ };
130
+ }
131
+ catch (error) {
132
+ console.error("Error deleting record:", error);
133
+ return {
134
+ content: [
135
+ {
136
+ type: "text",
137
+ text: `❌ Failed to delete record: ${error.message}`,
138
+ },
139
+ ],
140
+ isError: true,
141
+ };
142
+ }
143
+ });
144
+ server.tool("execute-action", "Execute a Custom API or Action in Dataverse. Supports both unbound actions (not tied to any entity) and bound actions (tied to a specific record). Requires POWERPLATFORM_ENABLE_ACTIONS=true.", {
145
+ actionName: z
146
+ .string()
147
+ .describe("The unique name of the Custom API or Action to execute (e.g., 'new_MyCustomAction', 'WhoAmI', 'WinOpportunity'). " +
148
+ "For bound actions, do NOT include the 'Microsoft.Dynamics.CRM.' prefix - it will be added automatically."),
149
+ parameters: z
150
+ .record(z.any())
151
+ .optional()
152
+ .describe("Input parameters for the action as JSON object. Parameter names and types must match the action definition. " +
153
+ "Example: { 'Amount': 100, 'Description': 'Test' }. Leave empty for actions with no input parameters."),
154
+ boundTo: z
155
+ .object({
156
+ entityNamePlural: z.string().describe(descWithExamples("The plural entity set name of the entity", ENTITY_NAME_EXAMPLES)),
157
+ recordId: z.string().describe("The GUID of the record to bind the action to"),
158
+ })
159
+ .optional()
160
+ .describe("For bound actions only: specify the entity and record the action is bound to. " +
161
+ "Leave empty for unbound actions. Example: { entityNamePlural: 'opportunities', recordId: '12345678-...' }"),
162
+ }, async ({ actionName, parameters, boundTo }) => {
163
+ try {
164
+ ctx.checkActionsEnabled();
165
+ const service = ctx.pp;
166
+ const result = await service.executeAction(actionName, parameters, boundTo);
167
+ const boundInfo = boundTo
168
+ ? `\n**Bound To:** ${boundTo.entityNamePlural}(${boundTo.recordId})`
169
+ : '\n**Type:** Unbound action';
170
+ const paramsInfo = parameters && Object.keys(parameters).length > 0
171
+ ? `\n**Input Parameters:**\n\`\`\`json\n${JSON.stringify(parameters, null, 2)}\n\`\`\``
172
+ : '';
173
+ const responseInfo = result && Object.keys(result).length > 0
174
+ ? `\n**Response:**\n\`\`\`json\n${JSON.stringify(result, null, 2)}\n\`\`\``
175
+ : '\n**Response:** (no output parameters)';
176
+ return {
177
+ content: [
178
+ {
179
+ type: "text",
180
+ text: `✅ Action executed successfully\n\n` +
181
+ `**Action:** ${actionName}` +
182
+ boundInfo +
183
+ paramsInfo +
184
+ responseInfo,
185
+ },
186
+ ],
187
+ };
188
+ }
189
+ catch (error) {
190
+ console.error("Error executing action:", error);
191
+ return {
192
+ content: [
193
+ {
194
+ type: "text",
195
+ text: `❌ Failed to execute action: ${error.message}`,
196
+ },
197
+ ],
198
+ isError: true,
199
+ };
200
+ }
201
+ });
202
+ server.tool("associate-records", "Associate two records via a navigation property (N:N or 1:N relationship). " +
203
+ "Use this for Many-to-Many relationships where intersect entities cannot be created directly. " +
204
+ "Requires POWERPLATFORM_ENABLE_CREATE=true.", {
205
+ entityNamePlural: z
206
+ .string()
207
+ .describe(descWithExamples("The plural entity set name of the source entity", ENTITY_NAME_EXAMPLES)),
208
+ recordId: z
209
+ .string()
210
+ .describe("The GUID of the source record"),
211
+ navigationProperty: z
212
+ .string()
213
+ .describe(descWithExamples("The navigation property name for the relationship. " +
214
+ "Find this in the relationship metadata or via get-entity-relationships tool in the read-only package", NAVIGATION_PROPERTY_EXAMPLES)),
215
+ targetEntityNamePlural: z
216
+ .string()
217
+ .describe(descWithExamples("The plural entity set name of the target entity", ENTITY_NAME_EXAMPLES)),
218
+ targetRecordId: z
219
+ .string()
220
+ .describe("The GUID of the target record to associate"),
221
+ }, async ({ entityNamePlural, recordId, navigationProperty, targetEntityNamePlural, targetRecordId }) => {
222
+ try {
223
+ ctx.checkCreateEnabled();
224
+ const service = ctx.pp;
225
+ await service.associateRecords(entityNamePlural, recordId, navigationProperty, targetEntityNamePlural, targetRecordId);
226
+ return {
227
+ content: [
228
+ {
229
+ type: "text",
230
+ text: `✅ Records associated successfully\n\n` +
231
+ `**Source:** ${entityNamePlural}(${recordId})\n` +
232
+ `**Target:** ${targetEntityNamePlural}(${targetRecordId})\n` +
233
+ `**Relationship:** ${navigationProperty}`,
234
+ },
235
+ ],
236
+ };
237
+ }
238
+ catch (error) {
239
+ console.error("Error associating records:", error);
240
+ return {
241
+ content: [
242
+ {
243
+ type: "text",
244
+ text: `❌ Failed to associate records: ${error.message}`,
245
+ },
246
+ ],
247
+ isError: true,
248
+ };
249
+ }
250
+ });
251
+ server.tool("disassociate-records", "Remove the association between two records (N:N or 1:N relationship). " +
252
+ "This removes the relationship link but does not delete either record. " +
253
+ "Requires POWERPLATFORM_ENABLE_DELETE=true.", {
254
+ entityNamePlural: z
255
+ .string()
256
+ .describe(descWithExamples("The plural entity set name of the source entity", ENTITY_NAME_EXAMPLES)),
257
+ recordId: z
258
+ .string()
259
+ .describe("The GUID of the source record"),
260
+ navigationProperty: z
261
+ .string()
262
+ .describe(descWithExamples("The navigation property name for the relationship", NAVIGATION_PROPERTY_EXAMPLES)),
263
+ targetRecordId: z
264
+ .string()
265
+ .describe("The GUID of the target record to disassociate"),
266
+ }, async ({ entityNamePlural, recordId, navigationProperty, targetRecordId }) => {
267
+ try {
268
+ ctx.checkDeleteEnabled();
269
+ const service = ctx.pp;
270
+ await service.disassociateRecords(entityNamePlural, recordId, navigationProperty, targetRecordId);
271
+ return {
272
+ content: [
273
+ {
274
+ type: "text",
275
+ text: `✅ Records disassociated successfully\n\n` +
276
+ `**Source:** ${entityNamePlural}(${recordId})\n` +
277
+ `**Target Record:** ${targetRecordId}\n` +
278
+ `**Relationship:** ${navigationProperty}\n\n` +
279
+ `Note: Neither record was deleted - only the relationship link was removed.`,
280
+ },
281
+ ],
282
+ };
283
+ }
284
+ catch (error) {
285
+ console.error("Error disassociating records:", error);
286
+ return {
287
+ content: [
288
+ {
289
+ type: "text",
290
+ text: `❌ Failed to disassociate records: ${error.message}`,
291
+ },
292
+ ],
293
+ isError: true,
294
+ };
295
+ }
296
+ });
297
+ }
298
+ //# sourceMappingURL=write-tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write-tools.js","sourceRoot":"","sources":["../../src/tools/write-tools.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;A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AO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,qCAAqC,KAAK,CAAC,OAAO,EAAE;qBAC3D;iBACF;gBACD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Service context shared between MCP server and CLI entry points.
3
+ * Uses lazy getters to initialize the PowerPlatformService on-demand.
4
+ */
5
+ import type { PowerPlatformService } from './PowerPlatformService.js';
6
+ export interface ServiceContext {
7
+ readonly pp: PowerPlatformService;
8
+ checkCreateEnabled(): void;
9
+ checkUpdateEnabled(): void;
10
+ checkDeleteEnabled(): void;
11
+ checkActionsEnabled(): void;
12
+ }
13
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEtE,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,EAAE,oBAAoB,CAAC;IAClC,kBAAkB,IAAI,IAAI,CAAC;IAC3B,kBAAkB,IAAI,IAAI,CAAC;IAC3B,kBAAkB,IAAI,IAAI,CAAC;IAC3B,mBAAmB,IAAI,IAAI,CAAC;CAC7B"}
package/build/types.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcp-consultant-tools/powerplatform-data",
3
- "version": "27.0.0",
3
+ "version": "28.0.0-beta.11",
4
4
  "description": "MCP server for PowerPlatform data CRUD operations (operational use)",
5
5
  "type": "module",
6
6
  "main": "./build/index.js",
@@ -40,9 +40,10 @@
40
40
  "node": ">=16.0.0"
41
41
  },
42
42
  "dependencies": {
43
- "@mcp-consultant-tools/core": "27.0.0-beta.1",
44
- "@mcp-consultant-tools/powerplatform-core": "27.0.0-beta.2",
43
+ "@mcp-consultant-tools/core": "28.0.0-beta.10",
44
+ "@mcp-consultant-tools/powerplatform-core": "28.0.0-beta.10",
45
45
  "@modelcontextprotocol/sdk": "^1.0.4",
46
+ "commander": "^14.0.3",
46
47
  "express": "^4.21.2",
47
48
  "zod": "^3.24.1"
48
49
  },
@@ -52,6 +53,7 @@
52
53
  "typescript": "^5.8.2"
53
54
  },
54
55
  "bin": {
55
- "mcp-pp-data": "build/index.js"
56
+ "mcp-pp-data": "build/index.js",
57
+ "mcp-pp-data-cli": "build/cli.js"
56
58
  }
57
59
  }