@kadoa/mcp 0.3.4 → 0.3.5-rc.1
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/dist/index.js +32 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -49275,7 +49275,13 @@ function registerTools(server, ctx) {
|
|
|
49275
49275
|
});
|
|
49276
49276
|
}));
|
|
49277
49277
|
server.registerTool("create_workflow", {
|
|
49278
|
-
description:
|
|
49278
|
+
description: `Create a new workflow that extracts data using agentic navigation. Supports one-time, scheduled, and real-time (continuous monitoring) modes via the interval parameter. If entity and schema are provided, they guide the extraction. Otherwise, the AI agent auto-detects the schema from the page based on the prompt. The workflow runs asynchronously and may take several minutes. Do NOT poll or sleep-wait for completion. Instead, return the workflow ID to the user and let them check back later with get_workflow or fetch_data.
|
|
49279
|
+
|
|
49280
|
+
` + `IMPORTANT — REAL_TIME vs regular workflows:
|
|
49281
|
+
` + `• REAL_TIME workflows are fundamentally different from regular extraction workflows. They route to a separate Observer service, run continuously, and cannot be triggered manually.
|
|
49282
|
+
` + `• A regular workflow CANNOT be converted to real-time after creation (and vice versa). The interval=REAL_TIME flag MUST be set at creation time.
|
|
49283
|
+
` + `• If the user wants to monitor a page for changes, set interval='REAL_TIME' here. Do NOT create a regular workflow and then try to change its interval to REAL_TIME via update_workflow — this will be rejected.
|
|
49284
|
+
` + "• When unclear whether the user wants monitoring (real-time) or data extraction (regular), ask them to clarify before creating the workflow.",
|
|
49279
49285
|
inputSchema: {
|
|
49280
49286
|
prompt: exports_external.string().describe('Natural language description of what to extract (e.g., "Extract product prices and names")'),
|
|
49281
49287
|
urls: exports_external.array(exports_external.string()).min(1).describe("Starting URLs for the workflow"),
|
|
@@ -49421,19 +49427,28 @@ function registerTools(server, ctx) {
|
|
|
49421
49427
|
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true }
|
|
49422
49428
|
}, withErrorHandling("get_workflow", async (args) => {
|
|
49423
49429
|
const workflow = await ctx.client.workflow.get(args.workflowId);
|
|
49430
|
+
const additionalData = workflow.additionalData;
|
|
49424
49431
|
return jsonResult({
|
|
49425
49432
|
id: workflow.id,
|
|
49426
49433
|
name: workflow.name,
|
|
49434
|
+
description: workflow.description,
|
|
49427
49435
|
status: workflow.displayState ?? workflow.state,
|
|
49428
49436
|
urls: workflow.urls,
|
|
49437
|
+
prompt: additionalData?.userPrompt,
|
|
49438
|
+
entity: workflow.entity,
|
|
49429
49439
|
schema: workflow.schema,
|
|
49430
49440
|
navigationMode: workflow.navigationMode,
|
|
49431
49441
|
updateInterval: workflow.updateInterval,
|
|
49442
|
+
schedules: workflow.schedules,
|
|
49443
|
+
nextInvocation: workflow.nextInvocation,
|
|
49444
|
+
limit: workflow.limit,
|
|
49445
|
+
tags: workflow.tags,
|
|
49432
49446
|
totalRecords: workflow.totalRecords,
|
|
49433
49447
|
startedAt: workflow.startedAt,
|
|
49434
49448
|
finishedAt: workflow.finishedAt,
|
|
49435
49449
|
errors: workflow.errors,
|
|
49436
|
-
createdAt: workflow.createdAt
|
|
49450
|
+
createdAt: workflow.createdAt,
|
|
49451
|
+
notificationConfig: workflow.notificationConfig
|
|
49437
49452
|
});
|
|
49438
49453
|
}));
|
|
49439
49454
|
server.registerTool("run_workflow", {
|
|
@@ -49505,7 +49520,9 @@ function registerTools(server, ctx) {
|
|
|
49505
49520
|
});
|
|
49506
49521
|
}));
|
|
49507
49522
|
server.registerTool("update_workflow", {
|
|
49508
|
-
description:
|
|
49523
|
+
description: `Update a workflow's configuration. All fields are optional — only provided fields will be updated. Use this to change the name, URLs, extraction schema, entity, prompt, schedule, or other metadata.
|
|
49524
|
+
|
|
49525
|
+
` + "IMPORTANT: You cannot change a workflow's interval to or from REAL_TIME. Real-time workflows are architecturally different (Observer service vs Scraper) and must be created as real-time from the start using create_workflow with interval='REAL_TIME'. To switch a workflow between real-time and regular, delete it and create a new one with the correct interval.",
|
|
49509
49526
|
inputSchema: {
|
|
49510
49527
|
workflowId: exports_external.string().describe("The workflow ID to update"),
|
|
49511
49528
|
name: exports_external.string().optional().describe("New name for the workflow"),
|
|
@@ -49532,15 +49549,25 @@ function registerTools(server, ctx) {
|
|
|
49532
49549
|
"TRIWEEKLY",
|
|
49533
49550
|
"FOUR_WEEKS",
|
|
49534
49551
|
"MONTHLY",
|
|
49535
|
-
"REAL_TIME",
|
|
49536
49552
|
"CUSTOM"
|
|
49537
|
-
]).optional().describe("How often the workflow should run.
|
|
49553
|
+
]).optional().describe("How often the workflow should run. CUSTOM requires schedules. Note: REAL_TIME is NOT allowed here — real-time workflows must be created via create_workflow."),
|
|
49538
49554
|
schedules: exports_external.array(exports_external.string()).optional().describe("Cron expressions for CUSTOM update interval"),
|
|
49539
49555
|
limit: exports_external.number().optional().describe("Maximum number of records to extract per run")
|
|
49540
49556
|
},
|
|
49541
49557
|
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true }
|
|
49542
49558
|
}, withErrorHandling("update_workflow", async (args) => {
|
|
49543
49559
|
const { workflowId, ...updates } = args;
|
|
49560
|
+
if (updates.updateInterval) {
|
|
49561
|
+
const workflow = await ctx.client.workflow.get(workflowId);
|
|
49562
|
+
const isCurrentlyRealTime = workflow.updateInterval === "REAL_TIME";
|
|
49563
|
+
const isRequestingRealTime = updates.updateInterval === "REAL_TIME";
|
|
49564
|
+
if (isRequestingRealTime && !isCurrentlyRealTime) {
|
|
49565
|
+
return errorResult("Cannot change a regular workflow's interval to REAL_TIME. " + "Real-time workflows use a different service (Observer) and must be created as real-time from the start. " + "Delete this workflow and create a new one with interval='REAL_TIME' using create_workflow.");
|
|
49566
|
+
}
|
|
49567
|
+
if (!isRequestingRealTime && isCurrentlyRealTime) {
|
|
49568
|
+
return errorResult("Cannot change a real-time workflow's interval to a scheduled interval. " + "Real-time workflows are architecturally different and cannot be converted to regular workflows. " + "Delete this workflow and create a new one with the desired interval using create_workflow.");
|
|
49569
|
+
}
|
|
49570
|
+
}
|
|
49544
49571
|
const result = await ctx.client.workflow.update(workflowId, updates);
|
|
49545
49572
|
return jsonResult({
|
|
49546
49573
|
success: true,
|