mcp-dataverse 0.1.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 (151) hide show
  1. package/.env.example +15 -0
  2. package/CAPABILITIES.md +992 -0
  3. package/LICENSE +21 -0
  4. package/README.md +277 -0
  5. package/config.example.json +11 -0
  6. package/dist/auth/auth-provider.factory.d.ts +4 -0
  7. package/dist/auth/auth-provider.factory.d.ts.map +1 -0
  8. package/dist/auth/auth-provider.factory.js +15 -0
  9. package/dist/auth/auth-provider.factory.js.map +1 -0
  10. package/dist/auth/auth-provider.interface.d.ts +21 -0
  11. package/dist/auth/auth-provider.interface.d.ts.map +1 -0
  12. package/dist/auth/auth-provider.interface.js +2 -0
  13. package/dist/auth/auth-provider.interface.js.map +1 -0
  14. package/dist/auth/msal-auth-provider.d.ts +14 -0
  15. package/dist/auth/msal-auth-provider.d.ts.map +1 -0
  16. package/dist/auth/msal-auth-provider.js +62 -0
  17. package/dist/auth/msal-auth-provider.js.map +1 -0
  18. package/dist/auth/pac-auth-provider.d.ts +19 -0
  19. package/dist/auth/pac-auth-provider.d.ts.map +1 -0
  20. package/dist/auth/pac-auth-provider.js +153 -0
  21. package/dist/auth/pac-auth-provider.js.map +1 -0
  22. package/dist/config/config.loader.d.ts +3 -0
  23. package/dist/config/config.loader.d.ts.map +1 -0
  24. package/dist/config/config.loader.js +52 -0
  25. package/dist/config/config.loader.js.map +1 -0
  26. package/dist/config/config.schema.d.ts +34 -0
  27. package/dist/config/config.schema.d.ts.map +1 -0
  28. package/dist/config/config.schema.js +25 -0
  29. package/dist/config/config.schema.js.map +1 -0
  30. package/dist/dataverse/dataverse-client-advanced.d.ts +47 -0
  31. package/dist/dataverse/dataverse-client-advanced.d.ts.map +1 -0
  32. package/dist/dataverse/dataverse-client-advanced.js +147 -0
  33. package/dist/dataverse/dataverse-client-advanced.js.map +1 -0
  34. package/dist/dataverse/dataverse-client.d.ts +49 -0
  35. package/dist/dataverse/dataverse-client.d.ts.map +1 -0
  36. package/dist/dataverse/dataverse-client.js +313 -0
  37. package/dist/dataverse/dataverse-client.js.map +1 -0
  38. package/dist/dataverse/dataverse-client.metadata.d.ts +40 -0
  39. package/dist/dataverse/dataverse-client.metadata.d.ts.map +1 -0
  40. package/dist/dataverse/dataverse-client.metadata.js +121 -0
  41. package/dist/dataverse/dataverse-client.metadata.js.map +1 -0
  42. package/dist/dataverse/dataverse-client.utils.d.ts +14 -0
  43. package/dist/dataverse/dataverse-client.utils.d.ts.map +1 -0
  44. package/dist/dataverse/dataverse-client.utils.js +65 -0
  45. package/dist/dataverse/dataverse-client.utils.js.map +1 -0
  46. package/dist/dataverse/http-client.d.ts +36 -0
  47. package/dist/dataverse/http-client.d.ts.map +1 -0
  48. package/dist/dataverse/http-client.js +103 -0
  49. package/dist/dataverse/http-client.js.map +1 -0
  50. package/dist/dataverse/types.d.ts +68 -0
  51. package/dist/dataverse/types.d.ts.map +1 -0
  52. package/dist/dataverse/types.js +2 -0
  53. package/dist/dataverse/types.js.map +1 -0
  54. package/dist/server.d.ts +3 -0
  55. package/dist/server.d.ts.map +1 -0
  56. package/dist/server.js +165 -0
  57. package/dist/server.js.map +1 -0
  58. package/dist/setup-auth.d.ts +2 -0
  59. package/dist/setup-auth.d.ts.map +1 -0
  60. package/dist/setup-auth.js +29 -0
  61. package/dist/setup-auth.js.map +1 -0
  62. package/dist/tools/actions.tools.d.ts +170 -0
  63. package/dist/tools/actions.tools.d.ts.map +1 -0
  64. package/dist/tools/actions.tools.js +179 -0
  65. package/dist/tools/actions.tools.js.map +1 -0
  66. package/dist/tools/annotations.tools.d.ts +82 -0
  67. package/dist/tools/annotations.tools.d.ts.map +1 -0
  68. package/dist/tools/annotations.tools.js +180 -0
  69. package/dist/tools/annotations.tools.js.map +1 -0
  70. package/dist/tools/audit.tools.d.ts +45 -0
  71. package/dist/tools/audit.tools.d.ts.map +1 -0
  72. package/dist/tools/audit.tools.js +163 -0
  73. package/dist/tools/audit.tools.js.map +1 -0
  74. package/dist/tools/auth.tools.d.ts +17 -0
  75. package/dist/tools/auth.tools.d.ts.map +1 -0
  76. package/dist/tools/auth.tools.js +30 -0
  77. package/dist/tools/auth.tools.js.map +1 -0
  78. package/dist/tools/batch.tools.d.ts +45 -0
  79. package/dist/tools/batch.tools.d.ts.map +1 -0
  80. package/dist/tools/batch.tools.js +71 -0
  81. package/dist/tools/batch.tools.js.map +1 -0
  82. package/dist/tools/crud.tools.d.ts +206 -0
  83. package/dist/tools/crud.tools.d.ts.map +1 -0
  84. package/dist/tools/crud.tools.js +213 -0
  85. package/dist/tools/crud.tools.js.map +1 -0
  86. package/dist/tools/customization.tools.d.ts +75 -0
  87. package/dist/tools/customization.tools.d.ts.map +1 -0
  88. package/dist/tools/customization.tools.js +187 -0
  89. package/dist/tools/customization.tools.js.map +1 -0
  90. package/dist/tools/environment.tools.d.ts +40 -0
  91. package/dist/tools/environment.tools.d.ts.map +1 -0
  92. package/dist/tools/environment.tools.js +145 -0
  93. package/dist/tools/environment.tools.js.map +1 -0
  94. package/dist/tools/file.tools.d.ts +61 -0
  95. package/dist/tools/file.tools.d.ts.map +1 -0
  96. package/dist/tools/file.tools.js +142 -0
  97. package/dist/tools/file.tools.js.map +1 -0
  98. package/dist/tools/impersonate.tools.d.ts +37 -0
  99. package/dist/tools/impersonate.tools.d.ts.map +1 -0
  100. package/dist/tools/impersonate.tools.js +85 -0
  101. package/dist/tools/impersonate.tools.js.map +1 -0
  102. package/dist/tools/metadata.tools.d.ts +156 -0
  103. package/dist/tools/metadata.tools.d.ts.map +1 -0
  104. package/dist/tools/metadata.tools.js +200 -0
  105. package/dist/tools/metadata.tools.js.map +1 -0
  106. package/dist/tools/org.tools.d.ts +26 -0
  107. package/dist/tools/org.tools.d.ts.map +1 -0
  108. package/dist/tools/org.tools.js +57 -0
  109. package/dist/tools/org.tools.js.map +1 -0
  110. package/dist/tools/quality.tools.d.ts +30 -0
  111. package/dist/tools/quality.tools.d.ts.map +1 -0
  112. package/dist/tools/quality.tools.js +69 -0
  113. package/dist/tools/quality.tools.js.map +1 -0
  114. package/dist/tools/query.tools.d.ts +120 -0
  115. package/dist/tools/query.tools.d.ts.map +1 -0
  116. package/dist/tools/query.tools.js +182 -0
  117. package/dist/tools/query.tools.js.map +1 -0
  118. package/dist/tools/relations.tools.d.ts +65 -0
  119. package/dist/tools/relations.tools.d.ts.map +1 -0
  120. package/dist/tools/relations.tools.js +64 -0
  121. package/dist/tools/relations.tools.js.map +1 -0
  122. package/dist/tools/search.tools.d.ts +68 -0
  123. package/dist/tools/search.tools.d.ts.map +1 -0
  124. package/dist/tools/search.tools.js +134 -0
  125. package/dist/tools/search.tools.js.map +1 -0
  126. package/dist/tools/solution.tools.d.ts +95 -0
  127. package/dist/tools/solution.tools.d.ts.map +1 -0
  128. package/dist/tools/solution.tools.js +130 -0
  129. package/dist/tools/solution.tools.js.map +1 -0
  130. package/dist/tools/teams.tools.d.ts +27 -0
  131. package/dist/tools/teams.tools.d.ts.map +1 -0
  132. package/dist/tools/teams.tools.js +67 -0
  133. package/dist/tools/teams.tools.js.map +1 -0
  134. package/dist/tools/trace.tools.d.ts +63 -0
  135. package/dist/tools/trace.tools.d.ts.map +1 -0
  136. package/dist/tools/trace.tools.js +218 -0
  137. package/dist/tools/trace.tools.js.map +1 -0
  138. package/dist/tools/tracking.tools.d.ts +35 -0
  139. package/dist/tools/tracking.tools.d.ts.map +1 -0
  140. package/dist/tools/tracking.tools.js +40 -0
  141. package/dist/tools/tracking.tools.js.map +1 -0
  142. package/dist/tools/users.tools.d.ts +57 -0
  143. package/dist/tools/users.tools.d.ts.map +1 -0
  144. package/dist/tools/users.tools.js +146 -0
  145. package/dist/tools/users.tools.js.map +1 -0
  146. package/dist/tools/views.tools.d.ts +30 -0
  147. package/dist/tools/views.tools.d.ts.map +1 -0
  148. package/dist/tools/views.tools.js +84 -0
  149. package/dist/tools/views.tools.js.map +1 -0
  150. package/package.json +81 -0
  151. package/server.json +30 -0
@@ -0,0 +1,179 @@
1
+ import { z } from 'zod';
2
+ export const actionTools = [
3
+ {
4
+ name: 'dataverse_execute_action',
5
+ description: 'Executes a global (unbound) Dataverse action that is not tied to a specific record — for example WinOpportunity, SendEmail, or custom process actions. Use dataverse_execute_bound_action when the action must operate on a particular record. Actions differ from functions in that they are state-changing operations; for read-only operations use dataverse_execute_function.',
6
+ inputSchema: {
7
+ type: 'object',
8
+ properties: {
9
+ actionName: { type: 'string', description: 'Action logical name (e.g., "WinOpportunity")' },
10
+ parameters: { type: 'object', description: 'Action parameters' },
11
+ },
12
+ required: ['actionName'],
13
+ },
14
+ },
15
+ {
16
+ name: 'dataverse_execute_function',
17
+ description: 'Executes a global (unbound) Dataverse OData function that is read-only and returns data without side effects — for example RetrieveTotalRecordCount or InitializeFrom. Use dataverse_execute_action for state-changing operations. Use dataverse_execute_bound_action when the function/action requires a specific record context.',
18
+ inputSchema: {
19
+ type: 'object',
20
+ properties: {
21
+ functionName: {
22
+ type: 'string',
23
+ description: 'Function name (e.g., "WhoAmI", "RetrieveTotalRecordCount")',
24
+ },
25
+ parameters: { type: 'object', description: 'Function parameters as string key-value pairs' },
26
+ },
27
+ required: ['functionName'],
28
+ },
29
+ },
30
+ {
31
+ name: 'dataverse_execute_bound_action',
32
+ description: 'Executes a Dataverse action bound to a specific record instance, passing the entity set name and record GUID as context (e.g., QualifyLead on a lead, or a custom action scoped to an account). The actionName should not include the Microsoft.Dynamics.CRM namespace prefix. Use dataverse_execute_action for global unbound actions that do not require a record context.',
33
+ inputSchema: {
34
+ type: 'object',
35
+ properties: {
36
+ entitySetName: { type: 'string' },
37
+ id: { type: 'string', description: 'Record GUID' },
38
+ actionName: { type: 'string', description: 'Action name (without Microsoft.Dynamics.CRM prefix)' },
39
+ parameters: { type: 'object', description: 'Action parameters' },
40
+ },
41
+ required: ['entitySetName', 'id', 'actionName'],
42
+ },
43
+ },
44
+ {
45
+ name: 'dataverse_retrieve_dependencies_for_delete',
46
+ description: 'Checks what solution components would block deletion of a specific component. Provide the Dataverse component type code (1=Entity, 2=Attribute, 26=SavedQuery, 29=Workflow, 92=PluginAssembly) and the component GUID. Use before deleting shared Dataverse customization components.',
47
+ inputSchema: {
48
+ type: 'object',
49
+ properties: {
50
+ componentType: {
51
+ type: 'number',
52
+ description: 'Dataverse component type code (1=Entity, 2=Attribute, 29=Workflow, 92=PluginAssembly)',
53
+ },
54
+ objectId: { type: 'string', description: 'Component GUID' },
55
+ },
56
+ required: ['componentType', 'objectId'],
57
+ },
58
+ },
59
+ {
60
+ name: 'dataverse_execute_bound_function',
61
+ description: 'Executes a Dataverse function bound to a specific record (e.g., CalculateRollupField, GetQuantityAvailable). Use for read-only computed operations on a single record. Unlike bound actions, bound functions do not modify data.',
62
+ inputSchema: {
63
+ type: 'object',
64
+ properties: {
65
+ entitySetName: { type: 'string', description: 'OData entity set name of the table (e.g., "accounts")' },
66
+ id: { type: 'string', description: 'GUID of the record' },
67
+ functionName: { type: 'string', description: 'Name of the bound function (e.g., "CalculateRollupField")' },
68
+ parameters: {
69
+ type: 'object',
70
+ description: 'Function parameters as key-value pairs of strings',
71
+ additionalProperties: { type: 'string' },
72
+ },
73
+ },
74
+ required: ['entitySetName', 'id', 'functionName'],
75
+ },
76
+ },
77
+ {
78
+ name: 'dataverse_list_dependencies',
79
+ description: 'Lists workflows, Power Automate flows, Business Rules, and custom actions that reference a given table. Use to detect hidden dependencies before modifying or removing a table. Returns component name, type, state (Active/Draft), trigger event (Create/Update/Delete), and count.',
80
+ inputSchema: {
81
+ type: 'object',
82
+ properties: {
83
+ tableName: {
84
+ type: 'string',
85
+ description: 'Logical name of the table to check (e.g., "account", "contact")',
86
+ },
87
+ componentType: {
88
+ type: 'array',
89
+ items: {
90
+ type: 'string',
91
+ enum: ['Workflow', 'Flow', 'BusinessRule', 'Action', 'BusinessProcessFlow', 'Plugin', 'CustomAPI'],
92
+ },
93
+ description: 'Filter by component type. Default: all types.',
94
+ },
95
+ },
96
+ required: ['tableName'],
97
+ },
98
+ },
99
+ ];
100
+ /** Allow only identifier-safe names: letters, digits, underscores, dots (for namespace prefixes). */
101
+ const SAFE_API_NAME = /^[a-zA-Z0-9_.]+$/;
102
+ const ExecuteActionInput = z.object({
103
+ actionName: z
104
+ .string()
105
+ .min(1)
106
+ .regex(SAFE_API_NAME, 'actionName must contain only letters, digits, underscores, or dots'),
107
+ parameters: z.record(z.unknown()).optional().default({}),
108
+ });
109
+ const ExecuteFunctionInput = z.object({
110
+ functionName: z
111
+ .string()
112
+ .min(1)
113
+ .regex(SAFE_API_NAME, 'functionName must contain only letters, digits, underscores, or dots'),
114
+ parameters: z.record(z.string()).optional().default({}),
115
+ });
116
+ const ExecuteBoundActionInput = z.object({
117
+ entitySetName: z.string().min(1),
118
+ id: z.string().uuid(),
119
+ actionName: z
120
+ .string()
121
+ .min(1)
122
+ .regex(SAFE_API_NAME, 'actionName must contain only letters, digits, underscores, or dots'),
123
+ parameters: z.record(z.unknown()).optional().default({}),
124
+ });
125
+ const RetrieveDependenciesForDeleteInput = z.object({
126
+ componentType: z.number().int().positive(),
127
+ objectId: z.string().uuid(),
128
+ });
129
+ const VALID_COMPONENT_TYPES = ['Workflow', 'Flow', 'BusinessRule', 'Action', 'BusinessProcessFlow', 'Plugin', 'CustomAPI'];
130
+ const ListTableDependenciesInput = z.object({
131
+ tableName: z.string().min(1),
132
+ componentType: z.array(z.enum(VALID_COMPONENT_TYPES)).optional(),
133
+ });
134
+ const ExecuteBoundFunctionInput = z.object({
135
+ entitySetName: z.string().min(1),
136
+ id: z.string().uuid(),
137
+ functionName: z
138
+ .string()
139
+ .min(1)
140
+ .regex(SAFE_API_NAME, 'functionName must contain only letters, digits, underscores, or dots'),
141
+ parameters: z.record(z.string()).optional().default({}),
142
+ });
143
+ export async function handleActionTool(name, args, client) {
144
+ switch (name) {
145
+ case 'dataverse_execute_action': {
146
+ const { actionName, parameters } = ExecuteActionInput.parse(args);
147
+ const result = await client.executeAction(actionName, parameters);
148
+ return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
149
+ }
150
+ case 'dataverse_execute_function': {
151
+ const { functionName, parameters } = ExecuteFunctionInput.parse(args);
152
+ const result = await client.executeFunction(functionName, parameters);
153
+ return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
154
+ }
155
+ case 'dataverse_execute_bound_action': {
156
+ const { entitySetName, id, actionName, parameters } = ExecuteBoundActionInput.parse(args);
157
+ const result = await client.executeBoundAction(entitySetName, id, actionName, parameters);
158
+ return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
159
+ }
160
+ case 'dataverse_list_dependencies': {
161
+ const { tableName, componentType } = ListTableDependenciesInput.parse(args);
162
+ const result = await client.listTableDependencies(tableName, componentType);
163
+ return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
164
+ }
165
+ case 'dataverse_retrieve_dependencies_for_delete': {
166
+ const { componentType, objectId } = RetrieveDependenciesForDeleteInput.parse(args);
167
+ const result = await client.listDependencies(componentType, objectId);
168
+ return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
169
+ }
170
+ case 'dataverse_execute_bound_function': {
171
+ const { entitySetName, id, functionName, parameters } = ExecuteBoundFunctionInput.parse(args);
172
+ const result = await client.executeBoundFunction(entitySetName, id, functionName, parameters);
173
+ return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
174
+ }
175
+ default:
176
+ throw new Error(`Unknown action tool: ${name}`);
177
+ }
178
+ }
179
+ //# sourceMappingURL=actions.tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actions.tools.js","sourceRoot":"","sources":["../../src/tools/actions.tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB;QACE,IAAI,EAAE,0BAA0B;QAChC,WAAW,EAAE,mXAAmX;QAChY,WAAW,EAAE;YACX,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,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,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;QAChF,CAAC;QACD,KAAK,4CAA4C,CAAC,CAAC,CAAC;YAClD,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,kCAAkC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACnF,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,gBAAgB,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;YACtE,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;QAChF,CAAC;QACD,KAAK,kCAAkC,CAAC,CAAC,CAAC;YACxC,MAAM,EAAE,aAAa,EAAE,EAAE,EAAE,YAAY,EAAE,UAAU,EAAE,GAAG,yBAAyB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAC9F,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,oBAAoB,CAAC,aAAa,EAAE,EAAE,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;YAC9F,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;QAChF,CAAC;QACD;YACE,MAAM,IAAI,KAAK,CAAC,wBAAwB,IAAI,EAAE,CAAC,CAAC;IACpD,CAAC;AACH,CAAC"}
@@ -0,0 +1,82 @@
1
+ import type { DataverseAdvancedClient } from '../dataverse/dataverse-client-advanced.js';
2
+ export declare const annotationTools: ({
3
+ name: string;
4
+ description: string;
5
+ inputSchema: {
6
+ type: "object";
7
+ properties: {
8
+ recordId: {
9
+ type: string;
10
+ description: string;
11
+ };
12
+ includeContent: {
13
+ type: string;
14
+ description: string;
15
+ default: boolean;
16
+ };
17
+ top: {
18
+ type: string;
19
+ description: string;
20
+ default: number;
21
+ };
22
+ mimeTypeFilter: {
23
+ type: string;
24
+ description: string;
25
+ };
26
+ entitySetName?: never;
27
+ notetext?: never;
28
+ subject?: never;
29
+ filename?: never;
30
+ mimetype?: never;
31
+ documentbody?: never;
32
+ };
33
+ required: string[];
34
+ };
35
+ } | {
36
+ name: string;
37
+ description: string;
38
+ inputSchema: {
39
+ type: "object";
40
+ properties: {
41
+ recordId: {
42
+ type: string;
43
+ description: string;
44
+ };
45
+ entitySetName: {
46
+ type: string;
47
+ description: string;
48
+ };
49
+ notetext: {
50
+ type: string;
51
+ description: string;
52
+ };
53
+ subject: {
54
+ type: string;
55
+ description: string;
56
+ };
57
+ filename: {
58
+ type: string;
59
+ description: string;
60
+ };
61
+ mimetype: {
62
+ type: string;
63
+ description: string;
64
+ };
65
+ documentbody: {
66
+ type: string;
67
+ description: string;
68
+ };
69
+ includeContent?: never;
70
+ top?: never;
71
+ mimeTypeFilter?: never;
72
+ };
73
+ required: string[];
74
+ };
75
+ })[];
76
+ export declare function handleAnnotationTool(name: string, args: unknown, client: DataverseAdvancedClient): Promise<{
77
+ content: Array<{
78
+ type: 'text';
79
+ text: string;
80
+ }>;
81
+ }>;
82
+ //# sourceMappingURL=annotations.tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"annotations.tools.d.ts","sourceRoot":"","sources":["../../src/tools/annotations.tools.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AAsBzF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAuE3B,CAAC;AAEF,wBAAsB,oBAAoB,CACtC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,OAAO,EACb,MAAM,EAAE,uBAAuB,GAChC,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CAmH7D"}
@@ -0,0 +1,180 @@
1
+ import { z } from 'zod';
2
+ const GetAnnotationsInput = z.object({
3
+ recordId: z.string().uuid(),
4
+ includeContent: z.boolean().optional().default(false),
5
+ top: z.number().int().positive().max(100).optional().default(20),
6
+ mimeTypeFilter: z.string().optional(),
7
+ });
8
+ const CreateAnnotationInput = z.object({
9
+ recordId: z.string().uuid(),
10
+ entitySetName: z.string().min(1),
11
+ notetext: z.string().optional(),
12
+ subject: z.string().optional(),
13
+ filename: z.string().optional(),
14
+ mimetype: z.string().optional(),
15
+ documentbody: z.string().optional(),
16
+ }).refine(data => Boolean(data.notetext) || Boolean(data.documentbody), { message: 'At least one of notetext or documentbody is required' });
17
+ export const annotationTools = [
18
+ {
19
+ name: 'dataverse_get_annotations',
20
+ description: 'Retrieves notes and file attachments (annotations) linked to a Dataverse record. Returns note text, file metadata (name, size, MIME type), owner, and timestamps. Set includeContent=true to also retrieve base64 file content (warning: can be very large).',
21
+ inputSchema: {
22
+ type: 'object',
23
+ properties: {
24
+ recordId: {
25
+ type: 'string',
26
+ description: "The parent record's GUID",
27
+ },
28
+ includeContent: {
29
+ type: 'boolean',
30
+ description: 'If true, include documentbody (base64). WARNING: can be very large.',
31
+ default: false,
32
+ },
33
+ top: {
34
+ type: 'number',
35
+ description: 'Maximum number of annotations to return (default 20, max 100)',
36
+ default: 20,
37
+ },
38
+ mimeTypeFilter: {
39
+ type: 'string',
40
+ description: 'Filter by MIME type (e.g. "application/pdf")',
41
+ },
42
+ },
43
+ required: ['recordId'],
44
+ },
45
+ },
46
+ {
47
+ name: 'dataverse_create_annotation',
48
+ description: 'Creates a note or file attachment (annotation) linked to a Dataverse record. Provide notetext for a text note, documentbody (base64) for a file attachment, or both. The parent record is identified by entitySetName and recordId.',
49
+ inputSchema: {
50
+ type: 'object',
51
+ properties: {
52
+ recordId: {
53
+ type: 'string',
54
+ description: "The parent record's GUID",
55
+ },
56
+ entitySetName: {
57
+ type: 'string',
58
+ description: 'The OData entity set name of the parent record (e.g., "accounts", "contacts")',
59
+ },
60
+ notetext: {
61
+ type: 'string',
62
+ description: 'Text content of the note',
63
+ },
64
+ subject: {
65
+ type: 'string',
66
+ description: 'Subject/title of the note',
67
+ },
68
+ filename: {
69
+ type: 'string',
70
+ description: 'File name (required when attaching a file)',
71
+ },
72
+ mimetype: {
73
+ type: 'string',
74
+ description: 'MIME type of the file (e.g., "application/pdf")',
75
+ },
76
+ documentbody: {
77
+ type: 'string',
78
+ description: 'Base64-encoded file content',
79
+ },
80
+ },
81
+ required: ['recordId', 'entitySetName'],
82
+ },
83
+ },
84
+ ];
85
+ export async function handleAnnotationTool(name, args, client) {
86
+ switch (name) {
87
+ case 'dataverse_get_annotations': {
88
+ const params = GetAnnotationsInput.parse(args);
89
+ const selectFields = [
90
+ 'annotationid',
91
+ 'subject',
92
+ 'notetext',
93
+ 'filename',
94
+ 'filesize',
95
+ 'mimetype',
96
+ 'isdocument',
97
+ 'createdon',
98
+ 'modifiedon',
99
+ ];
100
+ if (params.includeContent) {
101
+ selectFields.push('documentbody');
102
+ }
103
+ const filterParts = [`_objectid_value eq ${params.recordId}`];
104
+ if (params.mimeTypeFilter) {
105
+ filterParts.push(`mimetype eq '${params.mimeTypeFilter.replace(/'/g, "''")}'`);
106
+ }
107
+ const response = await client.query('annotations', {
108
+ select: selectFields,
109
+ filter: filterParts.join(' and '),
110
+ expand: 'ownerid($select=name)',
111
+ orderby: 'createdon desc',
112
+ top: params.top,
113
+ });
114
+ const rows = (response.value ?? []);
115
+ const annotations = rows.map((row) => {
116
+ const result = {
117
+ id: row['annotationid'] ?? '',
118
+ subject: row['subject'] ?? null,
119
+ noteText: row['notetext'] ?? null,
120
+ isDocument: row['isdocument'] === true,
121
+ createdOn: row['createdon'] ?? '',
122
+ modifiedOn: row['modifiedon'] ?? '',
123
+ owner: row['ownerid']?.['name'] ?? null,
124
+ };
125
+ if (row['isdocument'] === true) {
126
+ result.fileName = row['filename'] ?? null;
127
+ result.fileSize = row['filesize'] ?? null;
128
+ result.mimeType = row['mimetype'] ?? null;
129
+ }
130
+ if (params.includeContent && row['documentbody']) {
131
+ result.documentBody = row['documentbody'];
132
+ }
133
+ return result;
134
+ });
135
+ return {
136
+ content: [
137
+ {
138
+ type: 'text',
139
+ text: JSON.stringify({ recordId: params.recordId, annotations, count: annotations.length }, null, 2),
140
+ },
141
+ ],
142
+ };
143
+ }
144
+ case 'dataverse_create_annotation': {
145
+ const params = CreateAnnotationInput.parse(args);
146
+ const data = {
147
+ 'objectid@odata.bind': `/${params.entitySetName}(${params.recordId})`,
148
+ };
149
+ if (params.notetext !== undefined)
150
+ data['notetext'] = params.notetext;
151
+ if (params.subject !== undefined)
152
+ data['subject'] = params.subject;
153
+ if (params.filename !== undefined)
154
+ data['filename'] = params.filename;
155
+ if (params.mimetype !== undefined)
156
+ data['mimetype'] = params.mimetype;
157
+ if (params.documentbody !== undefined) {
158
+ data['documentbody'] = params.documentbody;
159
+ data['isdocument'] = true;
160
+ }
161
+ const annotationId = await client.createRecord('annotations', data);
162
+ return {
163
+ content: [
164
+ {
165
+ type: 'text',
166
+ text: JSON.stringify({
167
+ created: true,
168
+ annotationId,
169
+ parentRecordId: params.recordId,
170
+ entitySetName: params.entitySetName,
171
+ }, null, 2),
172
+ },
173
+ ],
174
+ };
175
+ }
176
+ default:
177
+ throw new Error(`Unknown annotation tool: ${name}`);
178
+ }
179
+ }
180
+ //# sourceMappingURL=annotations.tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"annotations.tools.js","sourceRoot":"","sources":["../../src/tools/annotations.tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC,QAAQ,EAAE,CAAC,CAAC,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AI,MAAM,CAAC,QAAQ,KAAK,SAAS;gBAAE,IAAI,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC;YACtE,IAAI,MAAM,CAAC,OAAO,KAAK,SAAS;gBAAE,IAAI,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC;YACnE,IAAI,MAAM,CAAC,QAAQ,KAAK,SAAS;gBAAE,IAAI,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC;YACtE,IAAI,MAAM,CAAC,QAAQ,KAAK,SAAS;gBAAE,IAAI,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC;YACtE,IAAI,MAAM,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;gBACpC,IAAI,CAAC,cAAc,CAAC,GAAG,MAAM,CAAC,YAAY,CAAC;gBAC3C,IAAI,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC;YAC9B,CAAC;YAED,MAAM,YAAY,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;YAEpE,OAAO;gBACH,OAAO,EAAE;oBACL;wBACI,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAChB;4BACI,OAAO,EAAE,IAAI;4BACb,YAAY;4BACZ,cAAc,EAAE,MAAM,CAAC,QAAQ;4BAC/B,aAAa,EAAE,MAAM,CAAC,aAAa;yBACtC,EACD,IAAI,EACJ,CAAC,CACJ;qBACJ;iBACJ;aACJ,CAAC;QACN,CAAC;QAED;YACI,MAAM,IAAI,KAAK,CAAC,4BAA4B,IAAI,EAAE,CAAC,CAAC;IAC5D,CAAC;AACL,CAAC"}
@@ -0,0 +1,45 @@
1
+ import type { DataverseAdvancedClient } from '../dataverse/dataverse-client-advanced.js';
2
+ export declare const auditTools: {
3
+ name: string;
4
+ description: string;
5
+ inputSchema: {
6
+ type: "object";
7
+ properties: {
8
+ recordId: {
9
+ type: string;
10
+ description: string;
11
+ };
12
+ entityLogicalName: {
13
+ type: string;
14
+ description: string;
15
+ };
16
+ userId: {
17
+ type: string;
18
+ description: string;
19
+ };
20
+ fromDate: {
21
+ type: string;
22
+ description: string;
23
+ };
24
+ top: {
25
+ type: string;
26
+ description: string;
27
+ };
28
+ operations: {
29
+ type: string;
30
+ items: {
31
+ type: string;
32
+ };
33
+ description: string;
34
+ };
35
+ };
36
+ required: never[];
37
+ };
38
+ }[];
39
+ export declare function handleAuditTool(name: string, args: unknown, client: DataverseAdvancedClient): Promise<{
40
+ content: Array<{
41
+ type: 'text';
42
+ text: string;
43
+ }>;
44
+ }>;
45
+ //# sourceMappingURL=audit.tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit.tools.d.ts","sourceRoot":"","sources":["../../src/tools/audit.tools.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AAkBzF,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCtB,CAAC;AAgEF,wBAAsB,eAAe,CACnC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,OAAO,EACb,MAAM,EAAE,uBAAuB,GAC9B,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CA+E7D"}