@centrali-io/centrali-mcp 4.2.1 → 4.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -179,4 +179,150 @@ function registerOrchestrationTools(server, sdk) {
179
179
  };
180
180
  }
181
181
  }));
182
+ server.tool("create_orchestration", "Create a new orchestration workflow. Orchestrations chain compute functions together in multi-step workflows.", {
183
+ slug: zod_1.z.string().describe("URL-friendly unique slug (e.g., 'order-processing')"),
184
+ name: zod_1.z.string().describe("Human-readable name"),
185
+ description: zod_1.z.string().optional().describe("Optional description of the workflow"),
186
+ trigger: zod_1.z
187
+ .record(zod_1.z.string(), zod_1.z.any())
188
+ .describe("Trigger configuration object. Must include 'type' (on-demand, event-driven, scheduled, webhook)"),
189
+ steps: zod_1.z
190
+ .array(zod_1.z.record(zod_1.z.string(), zod_1.z.any()))
191
+ .describe("Array of step definitions. Each step has id, type, functionId, and optional onSuccess/onFailure routing"),
192
+ }, (_a) => __awaiter(this, [_a], void 0, function* ({ slug, name, description, trigger, steps }) {
193
+ try {
194
+ const input = { slug, name, trigger, steps };
195
+ if (description !== undefined)
196
+ input.description = description;
197
+ const result = yield sdk.orchestrations.create(input);
198
+ return {
199
+ content: [{ type: "text", text: JSON.stringify(result.data, null, 2) }],
200
+ };
201
+ }
202
+ catch (error) {
203
+ return {
204
+ content: [
205
+ {
206
+ type: "text",
207
+ text: formatError(error, `creating orchestration '${slug}'`),
208
+ },
209
+ ],
210
+ isError: true,
211
+ };
212
+ }
213
+ }));
214
+ server.tool("update_orchestration", "Update an existing orchestration by ID. Only include the fields you want to change.", {
215
+ orchestrationId: zod_1.z.string().describe("The orchestration ID (UUID) to update"),
216
+ name: zod_1.z.string().optional().describe("Updated name"),
217
+ description: zod_1.z.string().optional().describe("Updated description"),
218
+ status: zod_1.z
219
+ .enum(["draft", "active", "paused"])
220
+ .optional()
221
+ .describe("Updated status"),
222
+ trigger: zod_1.z
223
+ .record(zod_1.z.string(), zod_1.z.any())
224
+ .optional()
225
+ .describe("Updated trigger configuration"),
226
+ steps: zod_1.z
227
+ .array(zod_1.z.record(zod_1.z.string(), zod_1.z.any()))
228
+ .optional()
229
+ .describe("Updated step definitions"),
230
+ }, (_a) => __awaiter(this, [_a], void 0, function* ({ orchestrationId, name, description, status, trigger, steps }) {
231
+ try {
232
+ const input = {};
233
+ if (name !== undefined)
234
+ input.name = name;
235
+ if (description !== undefined)
236
+ input.description = description;
237
+ if (status !== undefined)
238
+ input.status = status;
239
+ if (trigger !== undefined)
240
+ input.trigger = trigger;
241
+ if (steps !== undefined)
242
+ input.steps = steps;
243
+ const result = yield sdk.orchestrations.update(orchestrationId, input);
244
+ return {
245
+ content: [{ type: "text", text: JSON.stringify(result.data, null, 2) }],
246
+ };
247
+ }
248
+ catch (error) {
249
+ return {
250
+ content: [
251
+ {
252
+ type: "text",
253
+ text: formatError(error, `updating orchestration '${orchestrationId}'`),
254
+ },
255
+ ],
256
+ isError: true,
257
+ };
258
+ }
259
+ }));
260
+ server.tool("delete_orchestration", "Delete an orchestration by ID. This also deletes all runs associated with the orchestration.", {
261
+ orchestrationId: zod_1.z.string().describe("The orchestration ID (UUID) to delete"),
262
+ }, (_a) => __awaiter(this, [_a], void 0, function* ({ orchestrationId }) {
263
+ try {
264
+ yield sdk.orchestrations.delete(orchestrationId);
265
+ return {
266
+ content: [
267
+ {
268
+ type: "text",
269
+ text: `Orchestration '${orchestrationId}' deleted successfully.`,
270
+ },
271
+ ],
272
+ };
273
+ }
274
+ catch (error) {
275
+ return {
276
+ content: [
277
+ {
278
+ type: "text",
279
+ text: formatError(error, `deleting orchestration '${orchestrationId}'`),
280
+ },
281
+ ],
282
+ isError: true,
283
+ };
284
+ }
285
+ }));
286
+ server.tool("activate_orchestration", "Activate an orchestration. Active orchestrations can be triggered by scheduled events, record events, and webhooks.", {
287
+ orchestrationId: zod_1.z.string().describe("The orchestration ID (UUID) to activate"),
288
+ }, (_a) => __awaiter(this, [_a], void 0, function* ({ orchestrationId }) {
289
+ try {
290
+ const result = yield sdk.orchestrations.activate(orchestrationId);
291
+ return {
292
+ content: [{ type: "text", text: JSON.stringify(result.data, null, 2) }],
293
+ };
294
+ }
295
+ catch (error) {
296
+ return {
297
+ content: [
298
+ {
299
+ type: "text",
300
+ text: formatError(error, `activating orchestration '${orchestrationId}'`),
301
+ },
302
+ ],
303
+ isError: true,
304
+ };
305
+ }
306
+ }));
307
+ server.tool("pause_orchestration", "Pause an orchestration. Paused orchestrations cannot be triggered by any mechanism.", {
308
+ orchestrationId: zod_1.z.string().describe("The orchestration ID (UUID) to pause"),
309
+ }, (_a) => __awaiter(this, [_a], void 0, function* ({ orchestrationId }) {
310
+ try {
311
+ const result = yield sdk.orchestrations.pause(orchestrationId);
312
+ return {
313
+ content: [{ type: "text", text: JSON.stringify(result.data, null, 2) }],
314
+ };
315
+ }
316
+ catch (error) {
317
+ return {
318
+ content: [
319
+ {
320
+ type: "text",
321
+ text: formatError(error, `pausing orchestration '${orchestrationId}'`),
322
+ },
323
+ ],
324
+ isError: true,
325
+ };
326
+ }
327
+ }));
182
328
  }
@@ -93,4 +93,156 @@ function registerSmartQueryTools(server, sdk) {
93
93
  };
94
94
  }
95
95
  }));
96
+ server.tool("get_smart_query", "Get a smart query by ID. Returns the full query definition including filters, sort, and variable declarations.", {
97
+ recordSlug: zod_1.z.string().describe("The structure's record slug the query belongs to"),
98
+ queryId: zod_1.z.string().describe("The smart query ID (UUID)"),
99
+ }, (_a) => __awaiter(this, [_a], void 0, function* ({ recordSlug, queryId }) {
100
+ try {
101
+ const result = yield sdk.smartQueries.get(recordSlug, queryId);
102
+ return {
103
+ content: [
104
+ { type: "text", text: JSON.stringify(result.data, null, 2) },
105
+ ],
106
+ };
107
+ }
108
+ catch (error) {
109
+ return {
110
+ content: [
111
+ {
112
+ type: "text",
113
+ text: formatError(error, `getting smart query '${queryId}'`),
114
+ },
115
+ ],
116
+ isError: true,
117
+ };
118
+ }
119
+ }));
120
+ server.tool("create_smart_query", "Create a new smart query for a collection. Smart queries are reusable, parameterized queries with filter, sort, and variable support.", {
121
+ recordSlug: zod_1.z.string().describe("The structure's record slug to create the query for"),
122
+ name: zod_1.z.string().describe("Display name for the smart query"),
123
+ description: zod_1.z.string().optional().describe("Optional description"),
124
+ queryDefinition: zod_1.z
125
+ .record(zod_1.z.string(), zod_1.z.any())
126
+ .describe("The query definition object with where, sort, limit, select, join, etc."),
127
+ }, (_a) => __awaiter(this, [_a], void 0, function* ({ recordSlug, name, description, queryDefinition }) {
128
+ try {
129
+ const input = { name, queryDefinition };
130
+ if (description !== undefined)
131
+ input.description = description;
132
+ const result = yield sdk.smartQueries.create(recordSlug, input);
133
+ return {
134
+ content: [
135
+ { type: "text", text: JSON.stringify(result.data, null, 2) },
136
+ ],
137
+ };
138
+ }
139
+ catch (error) {
140
+ return {
141
+ content: [
142
+ {
143
+ type: "text",
144
+ text: formatError(error, `creating smart query '${name}' for '${recordSlug}'`),
145
+ },
146
+ ],
147
+ isError: true,
148
+ };
149
+ }
150
+ }));
151
+ server.tool("update_smart_query", "Update an existing smart query. Only include the fields you want to change.", {
152
+ recordSlug: zod_1.z.string().describe("The structure's record slug the query belongs to"),
153
+ queryId: zod_1.z.string().describe("The smart query ID (UUID) to update"),
154
+ name: zod_1.z.string().optional().describe("Updated display name"),
155
+ description: zod_1.z.string().optional().describe("Updated description"),
156
+ queryDefinition: zod_1.z
157
+ .record(zod_1.z.string(), zod_1.z.any())
158
+ .optional()
159
+ .describe("Updated query definition object"),
160
+ }, (_a) => __awaiter(this, [_a], void 0, function* ({ recordSlug, queryId, name, description, queryDefinition }) {
161
+ try {
162
+ const input = {};
163
+ if (name !== undefined)
164
+ input.name = name;
165
+ if (description !== undefined)
166
+ input.description = description;
167
+ if (queryDefinition !== undefined)
168
+ input.queryDefinition = queryDefinition;
169
+ const result = yield sdk.smartQueries.update(recordSlug, queryId, input);
170
+ return {
171
+ content: [
172
+ { type: "text", text: JSON.stringify(result.data, null, 2) },
173
+ ],
174
+ };
175
+ }
176
+ catch (error) {
177
+ return {
178
+ content: [
179
+ {
180
+ type: "text",
181
+ text: formatError(error, `updating smart query '${queryId}'`),
182
+ },
183
+ ],
184
+ isError: true,
185
+ };
186
+ }
187
+ }));
188
+ server.tool("delete_smart_query", "Delete a smart query by ID.", {
189
+ recordSlug: zod_1.z.string().describe("The structure's record slug the query belongs to"),
190
+ queryId: zod_1.z.string().describe("The smart query ID (UUID) to delete"),
191
+ }, (_a) => __awaiter(this, [_a], void 0, function* ({ recordSlug, queryId }) {
192
+ try {
193
+ yield sdk.smartQueries.delete(recordSlug, queryId);
194
+ return {
195
+ content: [
196
+ {
197
+ type: "text",
198
+ text: `Smart query '${queryId}' deleted from '${recordSlug}'.`,
199
+ },
200
+ ],
201
+ };
202
+ }
203
+ catch (error) {
204
+ return {
205
+ content: [
206
+ {
207
+ type: "text",
208
+ text: formatError(error, `deleting smart query '${queryId}'`),
209
+ },
210
+ ],
211
+ isError: true,
212
+ };
213
+ }
214
+ }));
215
+ server.tool("test_smart_query", "Test execute a query definition without saving it. Useful for validating query syntax and previewing results before creating a smart query.", {
216
+ recordSlug: zod_1.z.string().describe("The structure's record slug to test against"),
217
+ queryDefinition: zod_1.z
218
+ .record(zod_1.z.string(), zod_1.z.any())
219
+ .describe("The query definition to test (where, sort, limit, select, etc.)"),
220
+ variables: zod_1.z
221
+ .record(zod_1.z.string(), zod_1.z.string())
222
+ .optional()
223
+ .describe("Optional variables to substitute in the query"),
224
+ }, (_a) => __awaiter(this, [_a], void 0, function* ({ recordSlug, queryDefinition, variables }) {
225
+ try {
226
+ const input = { queryDefinition };
227
+ if (variables !== undefined)
228
+ input.variables = variables;
229
+ const result = yield sdk.smartQueries.test(recordSlug, input);
230
+ return {
231
+ content: [
232
+ { type: "text", text: JSON.stringify(result.data, null, 2) },
233
+ ],
234
+ };
235
+ }
236
+ catch (error) {
237
+ return {
238
+ content: [
239
+ {
240
+ type: "text",
241
+ text: formatError(error, `test-executing smart query for '${recordSlug}'`),
242
+ },
243
+ ],
244
+ isError: true,
245
+ };
246
+ }
247
+ }));
96
248
  }
@@ -135,4 +135,121 @@ function registerCollectionTools(server, sdk) {
135
135
  };
136
136
  }
137
137
  }));
138
+ server.tool("create_collection", "Create a new data collection (schema). Define the name, slug, description, and properties (fields) for the collection.", {
139
+ name: zod_1.z.string().describe("Display name for the collection (e.g., 'Customers')"),
140
+ slug: zod_1.z.string().describe("URL-safe identifier used in API calls (e.g., 'customers')"),
141
+ description: zod_1.z.string().optional().describe("Optional description of the collection"),
142
+ properties: zod_1.z
143
+ .array(zod_1.z.record(zod_1.z.string(), zod_1.z.any()))
144
+ .optional()
145
+ .describe("Array of property definitions. Each property has name, type, and optional config (required, unique, defaultValue, description, config)"),
146
+ enableVersioning: zod_1.z.boolean().optional().describe("Enable record versioning (default: false)"),
147
+ schemaDiscoveryMode: zod_1.z
148
+ .enum(["strict", "flexible"])
149
+ .optional()
150
+ .describe("Schema discovery mode: 'strict' rejects unknown fields, 'flexible' auto-adds them"),
151
+ tags: zod_1.z.array(zod_1.z.string()).optional().describe("Optional tags for organizing collections"),
152
+ }, (_a) => __awaiter(this, [_a], void 0, function* ({ name, slug, description, properties, enableVersioning, schemaDiscoveryMode, tags }) {
153
+ try {
154
+ const input = { name, slug };
155
+ if (description !== undefined)
156
+ input.description = description;
157
+ if (properties !== undefined)
158
+ input.properties = properties;
159
+ if (enableVersioning !== undefined)
160
+ input.enableVersioning = enableVersioning;
161
+ if (schemaDiscoveryMode !== undefined)
162
+ input.schemaDiscoveryMode = schemaDiscoveryMode;
163
+ if (tags !== undefined)
164
+ input.tags = tags;
165
+ const result = yield sdk.collections.create(input);
166
+ return {
167
+ content: [
168
+ { type: "text", text: JSON.stringify(result.data, null, 2) },
169
+ ],
170
+ };
171
+ }
172
+ catch (error) {
173
+ return {
174
+ content: [
175
+ {
176
+ type: "text",
177
+ text: formatError(error, `creating collection '${slug}'`),
178
+ },
179
+ ],
180
+ isError: true,
181
+ };
182
+ }
183
+ }));
184
+ server.tool("update_collection", "Update an existing collection by ID. Only include the fields you want to change.", {
185
+ collectionId: zod_1.z.string().describe("The collection ID (UUID) to update"),
186
+ name: zod_1.z.string().optional().describe("Updated display name"),
187
+ description: zod_1.z.string().optional().describe("Updated description"),
188
+ properties: zod_1.z
189
+ .array(zod_1.z.record(zod_1.z.string(), zod_1.z.any()))
190
+ .optional()
191
+ .describe("Updated array of property definitions (replaces existing properties)"),
192
+ enableVersioning: zod_1.z.boolean().optional().describe("Enable or disable record versioning"),
193
+ tags: zod_1.z.array(zod_1.z.string()).optional().describe("Updated tags"),
194
+ defaultTtlSeconds: zod_1.z.number().nullable().optional().describe("Default TTL in seconds for new records. Set to null to clear."),
195
+ }, (_a) => __awaiter(this, [_a], void 0, function* ({ collectionId, name, description, properties, enableVersioning, tags, defaultTtlSeconds }) {
196
+ try {
197
+ const input = {};
198
+ if (name !== undefined)
199
+ input.name = name;
200
+ if (description !== undefined)
201
+ input.description = description;
202
+ if (properties !== undefined)
203
+ input.properties = properties;
204
+ if (enableVersioning !== undefined)
205
+ input.enableVersioning = enableVersioning;
206
+ if (tags !== undefined)
207
+ input.tags = tags;
208
+ if (defaultTtlSeconds !== undefined)
209
+ input.defaultTtlSeconds = defaultTtlSeconds;
210
+ const result = yield sdk.collections.update(collectionId, input);
211
+ return {
212
+ content: [
213
+ { type: "text", text: JSON.stringify(result.data, null, 2) },
214
+ ],
215
+ };
216
+ }
217
+ catch (error) {
218
+ return {
219
+ content: [
220
+ {
221
+ type: "text",
222
+ text: formatError(error, `updating collection '${collectionId}'`),
223
+ },
224
+ ],
225
+ isError: true,
226
+ };
227
+ }
228
+ }));
229
+ server.tool("delete_collection", "Delete a collection by ID. This permanently removes the collection schema and all its records.", {
230
+ collectionId: zod_1.z.string().describe("The collection ID (UUID) to delete"),
231
+ }, (_a) => __awaiter(this, [_a], void 0, function* ({ collectionId }) {
232
+ try {
233
+ yield sdk.collections.delete(collectionId);
234
+ return {
235
+ content: [
236
+ {
237
+ type: "text",
238
+ text: `Collection '${collectionId}' deleted successfully.`,
239
+ },
240
+ ],
241
+ };
242
+ }
243
+ catch (error) {
244
+ return {
245
+ content: [
246
+ {
247
+ type: "text",
248
+ text: formatError(error, `deleting collection '${collectionId}'`),
249
+ },
250
+ ],
251
+ isError: true,
252
+ };
253
+ }
254
+ }));
138
255
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@centrali-io/centrali-mcp",
3
- "version": "4.2.1",
3
+ "version": "4.2.2",
4
4
  "description": "Centrali MCP Server - AI assistant integration for Centrali workspaces",
5
5
  "main": "dist/index.js",
6
6
  "type": "commonjs",