@centrali-io/centrali-mcp 4.2.0 → 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.
- package/README.md +25 -1
- package/dist/index.js +4 -0
- package/dist/tools/compute.js +323 -0
- package/dist/tools/describe.d.ts +10 -0
- package/dist/tools/describe.js +1485 -0
- package/dist/tools/orchestrations.js +146 -0
- package/dist/tools/pages.d.ts +3 -0
- package/dist/tools/pages.js +477 -0
- package/dist/tools/smart-queries.js +152 -0
- package/dist/tools/structures.js +117 -0
- package/package.json +2 -2
- package/src/index.ts +4 -0
- package/src/tools/compute.ts +371 -0
- package/src/tools/describe.ts +1798 -0
- package/src/tools/orchestrations.ts +167 -0
- package/src/tools/pages.ts +573 -0
- package/src/tools/smart-queries.ts +175 -0
- package/src/tools/structures.ts +123 -0
|
@@ -206,4 +206,171 @@ export function registerOrchestrationTools(server: McpServer, sdk: CentraliSDK)
|
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
208
|
);
|
|
209
|
+
|
|
210
|
+
server.tool(
|
|
211
|
+
"create_orchestration",
|
|
212
|
+
"Create a new orchestration workflow. Orchestrations chain compute functions together in multi-step workflows.",
|
|
213
|
+
{
|
|
214
|
+
slug: z.string().describe("URL-friendly unique slug (e.g., 'order-processing')"),
|
|
215
|
+
name: z.string().describe("Human-readable name"),
|
|
216
|
+
description: z.string().optional().describe("Optional description of the workflow"),
|
|
217
|
+
trigger: z
|
|
218
|
+
.record(z.string(), z.any())
|
|
219
|
+
.describe("Trigger configuration object. Must include 'type' (on-demand, event-driven, scheduled, webhook)"),
|
|
220
|
+
steps: z
|
|
221
|
+
.array(z.record(z.string(), z.any()))
|
|
222
|
+
.describe("Array of step definitions. Each step has id, type, functionId, and optional onSuccess/onFailure routing"),
|
|
223
|
+
},
|
|
224
|
+
async ({ slug, name, description, trigger, steps }) => {
|
|
225
|
+
try {
|
|
226
|
+
const input: Record<string, any> = { slug, name, trigger, steps };
|
|
227
|
+
if (description !== undefined) input.description = description;
|
|
228
|
+
|
|
229
|
+
const result = await sdk.orchestrations.create(input as any);
|
|
230
|
+
return {
|
|
231
|
+
content: [{ type: "text", text: JSON.stringify(result.data, null, 2) }],
|
|
232
|
+
};
|
|
233
|
+
} catch (error: unknown) {
|
|
234
|
+
return {
|
|
235
|
+
content: [
|
|
236
|
+
{
|
|
237
|
+
type: "text",
|
|
238
|
+
text: formatError(error, `creating orchestration '${slug}'`),
|
|
239
|
+
},
|
|
240
|
+
],
|
|
241
|
+
isError: true,
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
);
|
|
246
|
+
|
|
247
|
+
server.tool(
|
|
248
|
+
"update_orchestration",
|
|
249
|
+
"Update an existing orchestration by ID. Only include the fields you want to change.",
|
|
250
|
+
{
|
|
251
|
+
orchestrationId: z.string().describe("The orchestration ID (UUID) to update"),
|
|
252
|
+
name: z.string().optional().describe("Updated name"),
|
|
253
|
+
description: z.string().optional().describe("Updated description"),
|
|
254
|
+
status: z
|
|
255
|
+
.enum(["draft", "active", "paused"])
|
|
256
|
+
.optional()
|
|
257
|
+
.describe("Updated status"),
|
|
258
|
+
trigger: z
|
|
259
|
+
.record(z.string(), z.any())
|
|
260
|
+
.optional()
|
|
261
|
+
.describe("Updated trigger configuration"),
|
|
262
|
+
steps: z
|
|
263
|
+
.array(z.record(z.string(), z.any()))
|
|
264
|
+
.optional()
|
|
265
|
+
.describe("Updated step definitions"),
|
|
266
|
+
},
|
|
267
|
+
async ({ orchestrationId, name, description, status, trigger, steps }) => {
|
|
268
|
+
try {
|
|
269
|
+
const input: Record<string, any> = {};
|
|
270
|
+
if (name !== undefined) input.name = name;
|
|
271
|
+
if (description !== undefined) input.description = description;
|
|
272
|
+
if (status !== undefined) input.status = status;
|
|
273
|
+
if (trigger !== undefined) input.trigger = trigger;
|
|
274
|
+
if (steps !== undefined) input.steps = steps;
|
|
275
|
+
|
|
276
|
+
const result = await sdk.orchestrations.update(orchestrationId, input as any);
|
|
277
|
+
return {
|
|
278
|
+
content: [{ type: "text", text: JSON.stringify(result.data, null, 2) }],
|
|
279
|
+
};
|
|
280
|
+
} catch (error: unknown) {
|
|
281
|
+
return {
|
|
282
|
+
content: [
|
|
283
|
+
{
|
|
284
|
+
type: "text",
|
|
285
|
+
text: formatError(error, `updating orchestration '${orchestrationId}'`),
|
|
286
|
+
},
|
|
287
|
+
],
|
|
288
|
+
isError: true,
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
);
|
|
293
|
+
|
|
294
|
+
server.tool(
|
|
295
|
+
"delete_orchestration",
|
|
296
|
+
"Delete an orchestration by ID. This also deletes all runs associated with the orchestration.",
|
|
297
|
+
{
|
|
298
|
+
orchestrationId: z.string().describe("The orchestration ID (UUID) to delete"),
|
|
299
|
+
},
|
|
300
|
+
async ({ orchestrationId }) => {
|
|
301
|
+
try {
|
|
302
|
+
await sdk.orchestrations.delete(orchestrationId);
|
|
303
|
+
return {
|
|
304
|
+
content: [
|
|
305
|
+
{
|
|
306
|
+
type: "text",
|
|
307
|
+
text: `Orchestration '${orchestrationId}' deleted successfully.`,
|
|
308
|
+
},
|
|
309
|
+
],
|
|
310
|
+
};
|
|
311
|
+
} catch (error: unknown) {
|
|
312
|
+
return {
|
|
313
|
+
content: [
|
|
314
|
+
{
|
|
315
|
+
type: "text",
|
|
316
|
+
text: formatError(error, `deleting orchestration '${orchestrationId}'`),
|
|
317
|
+
},
|
|
318
|
+
],
|
|
319
|
+
isError: true,
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
);
|
|
324
|
+
|
|
325
|
+
server.tool(
|
|
326
|
+
"activate_orchestration",
|
|
327
|
+
"Activate an orchestration. Active orchestrations can be triggered by scheduled events, record events, and webhooks.",
|
|
328
|
+
{
|
|
329
|
+
orchestrationId: z.string().describe("The orchestration ID (UUID) to activate"),
|
|
330
|
+
},
|
|
331
|
+
async ({ orchestrationId }) => {
|
|
332
|
+
try {
|
|
333
|
+
const result = await sdk.orchestrations.activate(orchestrationId);
|
|
334
|
+
return {
|
|
335
|
+
content: [{ type: "text", text: JSON.stringify(result.data, null, 2) }],
|
|
336
|
+
};
|
|
337
|
+
} catch (error: unknown) {
|
|
338
|
+
return {
|
|
339
|
+
content: [
|
|
340
|
+
{
|
|
341
|
+
type: "text",
|
|
342
|
+
text: formatError(error, `activating orchestration '${orchestrationId}'`),
|
|
343
|
+
},
|
|
344
|
+
],
|
|
345
|
+
isError: true,
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
);
|
|
350
|
+
|
|
351
|
+
server.tool(
|
|
352
|
+
"pause_orchestration",
|
|
353
|
+
"Pause an orchestration. Paused orchestrations cannot be triggered by any mechanism.",
|
|
354
|
+
{
|
|
355
|
+
orchestrationId: z.string().describe("The orchestration ID (UUID) to pause"),
|
|
356
|
+
},
|
|
357
|
+
async ({ orchestrationId }) => {
|
|
358
|
+
try {
|
|
359
|
+
const result = await sdk.orchestrations.pause(orchestrationId);
|
|
360
|
+
return {
|
|
361
|
+
content: [{ type: "text", text: JSON.stringify(result.data, null, 2) }],
|
|
362
|
+
};
|
|
363
|
+
} catch (error: unknown) {
|
|
364
|
+
return {
|
|
365
|
+
content: [
|
|
366
|
+
{
|
|
367
|
+
type: "text",
|
|
368
|
+
text: formatError(error, `pausing orchestration '${orchestrationId}'`),
|
|
369
|
+
},
|
|
370
|
+
],
|
|
371
|
+
isError: true,
|
|
372
|
+
};
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
);
|
|
209
376
|
}
|