@kadoa/mcp 0.6.2 → 0.6.3
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 +0 -3
- package/dist/index.js +2 -171
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -77,8 +77,6 @@ Point your client to `https://mcp.kadoa.com/mcp` with OAuth authentication.
|
|
|
77
77
|
| `get_workflow_history` | Get the workflow's configuration revision history (audit log) — who changed it, when, from which channel, and a `changedFields` summary per revision |
|
|
78
78
|
| `list_activity` | List the team's Activity log (audit trail) across all workflows and resources: actor email, resource name, action, interface, timestamp, change summary; filter by time window, user, workflow, action, interface, resource type. Use `get_workflow_history` for one workflow's config diffs |
|
|
79
79
|
| `list_workflow_runs` | List a workflow's execution run history (status, start/finish, record count, errors); filter by outcome and paginate |
|
|
80
|
-
| `get_usage` | Current plan usage for the active team or its organization: workflow slot quota and usage, billable and active workflows, extracted rows, billing period and renewal date |
|
|
81
|
-
| `get_usage_history` | Daily usage history (active workflows, billing-period cumulative, or daily activity) for up to 366 days |
|
|
82
80
|
| `get_observability` | Team-wide workflow health for a window of days: uptime, failed runs, MTTR, records delivered, health counts, and a ranked list of down or degraded workflows (the Observability page data) |
|
|
83
81
|
| `run_workflow` | Execute a workflow |
|
|
84
82
|
| `fetch_data` | Get extracted data from a workflow |
|
|
@@ -98,7 +96,6 @@ For detailed customer guidance, see the [Kadoa documentation](https://docs.kadoa
|
|
|
98
96
|
- **Run history:** `list_workflow_runs` filters by `status` (`success`, `failed`, or `in_progress`) and supports 1-based `page` and `limit` pagination.
|
|
99
97
|
- **Notifications:** `create_realtime_monitor` requires at least one email, webhook, Slack, or WebSocket notification channel. Notifications are optional when creating a standard one-time or scheduled workflow with `create_workflow`.
|
|
100
98
|
- **Template changes:** `update_template` changes template name and description only. To change template-controlled configuration, create an immutable version with `create_template_version`, then roll it out to linked workflows with `apply_template_version`.
|
|
101
|
-
- **Usage:** `get_usage` reports slots and rows, not credits. `usedThisPeriod` resets at the renewal date; `usedActive` is the current slot count; `usedAllTime` never resets. Pass `scope: "organization"` to match the Usage page for organization members.
|
|
102
99
|
|
|
103
100
|
## Usage Examples
|
|
104
101
|
|
package/dist/index.js
CHANGED
|
@@ -45841,31 +45841,6 @@ function mapActivityEvent2(event, includeDetails) {
|
|
|
45841
45841
|
...includeDetails ? { details: { previousValue: details.previousValue, newValue: details.newValue } } : {}
|
|
45842
45842
|
};
|
|
45843
45843
|
}
|
|
45844
|
-
function shapeUsageWorkflows(workflows, limit) {
|
|
45845
|
-
const sorted = [...workflows].sort((a, b) => b.slotWeight - a.slotWeight || b.runsInPeriod - a.runsInPeriod || (a.name ?? "").localeCompare(b.name ?? ""));
|
|
45846
|
-
return {
|
|
45847
|
-
totalCount: workflows.length,
|
|
45848
|
-
truncated: sorted.length > limit,
|
|
45849
|
-
items: sorted.slice(0, limit)
|
|
45850
|
-
};
|
|
45851
|
-
}
|
|
45852
|
-
function usagePeriodProgress(period, now) {
|
|
45853
|
-
if (!period)
|
|
45854
|
-
return null;
|
|
45855
|
-
const start = Date.parse(period.start);
|
|
45856
|
-
const end = Date.parse(period.end);
|
|
45857
|
-
if (Number.isNaN(start) || Number.isNaN(end) || end <= start)
|
|
45858
|
-
return null;
|
|
45859
|
-
const total = end - start;
|
|
45860
|
-
const elapsed = Math.min(Math.max(now.getTime() - start, 0), total);
|
|
45861
|
-
const totalDays = total / DAY_MS;
|
|
45862
|
-
const daysElapsed = Math.floor(elapsed / DAY_MS);
|
|
45863
|
-
return {
|
|
45864
|
-
daysElapsed,
|
|
45865
|
-
daysRemaining: Math.ceil((total - elapsed) / DAY_MS),
|
|
45866
|
-
percentElapsed: Math.round(daysElapsed / totalDays * 100)
|
|
45867
|
-
};
|
|
45868
|
-
}
|
|
45869
45844
|
function rankWorkflowsBySeverity(workflows) {
|
|
45870
45845
|
return [...workflows].sort((a, b) => {
|
|
45871
45846
|
const bySeverity = HEALTH_SEVERITY[a.health] - HEALTH_SEVERITY[b.health];
|
|
@@ -47462,150 +47437,6 @@ function registerTools(server, ctx, capabilities) {
|
|
|
47462
47437
|
message: `Switched to team "${match.name}". All subsequent API calls will use this team.`
|
|
47463
47438
|
});
|
|
47464
47439
|
}));
|
|
47465
|
-
const usageScopeInput = _enum(["team", "organization"]).optional().describe("Which workspace to report. 'team' (default) is the active team. 'organization' is the whole organization that owns the active team, matching the Usage page for organization members. Errors for a standalone team.");
|
|
47466
|
-
function usageTeamId() {
|
|
47467
|
-
const teamId = ctx.teamId ?? ctx.principal.teamId;
|
|
47468
|
-
if (!teamId)
|
|
47469
|
-
throw new Error("No active team on this session; run team_list first");
|
|
47470
|
-
return teamId;
|
|
47471
|
-
}
|
|
47472
|
-
server.registerTool("get_usage", {
|
|
47473
|
-
description: "Current plan usage for the active team (or its organization): workflow slot quota and slots used, workflows counted by each billing rule, extracted rows this billing period, the billing period with renewal date, and the workflows behind the numbers. " + "Kadoa has no credits; usage is measured in workflow slots (each workflow weighs 0.1, 1, or 2-10 slots) and extracted rows. " + "Use for questions like 'how much of my plan have I used', 'when does my contract renew', 'which workflows are billing this period', 'am I near my limit'. " + "For trends over time use get_usage_history. For a single workflow's runs use list_workflow_runs. " + "'usedThisPeriod' values reset at the renewal date; 'usedActive' is the number of slots in use right now; 'usedAllTime' never resets. A null billingPeriod means a trial or a contract without a renewal date, and period-scoped values are then null too. Quote workflows by name; ids are stripped from customer-facing text.",
|
|
47474
|
-
inputSchema: {
|
|
47475
|
-
scope: usageScopeInput,
|
|
47476
|
-
includeWorkflows: preprocess(coerceBoolean(), boolean2()).optional().describe("Include the billable and active workflow lists (default true). Set false for a numbers-only answer."),
|
|
47477
|
-
workflowLimit: preprocess(coerceNumber(), number2().int().min(1).max(100)).optional().describe("Maximum workflows per list, heaviest slot weight first (default 25, max 100).")
|
|
47478
|
-
},
|
|
47479
|
-
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true }
|
|
47480
|
-
}, withErrorHandling("get_usage", async (args) => {
|
|
47481
|
-
const scope = args.scope ?? "team";
|
|
47482
|
-
const includeWorkflows = args.includeWorkflows ?? true;
|
|
47483
|
-
const workflowLimit = args.workflowLimit ?? 25;
|
|
47484
|
-
const workspace = await ctx.client.usage.resolveWorkspace(usageTeamId(), scope);
|
|
47485
|
-
const [quotas, billable] = await Promise.all([
|
|
47486
|
-
ctx.client.usage.getQuotas(workspace.workspaceId),
|
|
47487
|
-
includeWorkflows ? ctx.client.usage.listBillableWorkflows(workspace.workspaceId) : Promise.resolve(null)
|
|
47488
|
-
]);
|
|
47489
|
-
const progress = usagePeriodProgress(quotas.billingPeriod, new Date);
|
|
47490
|
-
const shapeItems = (list) => {
|
|
47491
|
-
const shaped = shapeUsageWorkflows(list, workflowLimit);
|
|
47492
|
-
return {
|
|
47493
|
-
totalCount: shaped.totalCount,
|
|
47494
|
-
truncated: shaped.truncated,
|
|
47495
|
-
items: shaped.items.map((w) => ({
|
|
47496
|
-
workflowId: w.workflowId,
|
|
47497
|
-
name: w.name,
|
|
47498
|
-
state: w.state,
|
|
47499
|
-
scheduled: w.scheduled,
|
|
47500
|
-
slotWeight: w.slotWeight,
|
|
47501
|
-
runsInPeriod: w.runsInPeriod,
|
|
47502
|
-
rowsExtracted: w.rowsExtracted,
|
|
47503
|
-
firstRunAt: w.firstRunAt
|
|
47504
|
-
}))
|
|
47505
|
-
};
|
|
47506
|
-
};
|
|
47507
|
-
return jsonResult({
|
|
47508
|
-
workspace: { id: workspace.workspaceId, type: workspace.workspaceType, name: workspace.name },
|
|
47509
|
-
billingModel: quotas.billingModel,
|
|
47510
|
-
billingPeriod: quotas.billingPeriod ? {
|
|
47511
|
-
start: quotas.billingPeriod.start,
|
|
47512
|
-
end: quotas.billingPeriod.end,
|
|
47513
|
-
renewalDate: quotas.billingPeriod.renewalDate,
|
|
47514
|
-
...progress
|
|
47515
|
-
} : null,
|
|
47516
|
-
workflowSlots: {
|
|
47517
|
-
limit: quotas.limits.workflowSlots,
|
|
47518
|
-
usedActive: quotas.used.activeWorkflowSlots,
|
|
47519
|
-
usedThisPeriod: quotas.used.contractActiveWorkflowSlots,
|
|
47520
|
-
usedPreviousPeriod: quotas.used.previousContractActiveWorkflowSlots
|
|
47521
|
-
},
|
|
47522
|
-
workflows: {
|
|
47523
|
-
total: quotas.used.totalWorkflows,
|
|
47524
|
-
active: quotas.used.activeWorkflows,
|
|
47525
|
-
active35Days: quotas.used.active35Workflows,
|
|
47526
|
-
billableThisPeriod: quotas.used.contractActiveWorkflows,
|
|
47527
|
-
billablePreviousPeriod: quotas.used.previousContractActiveWorkflows,
|
|
47528
|
-
scheduledIntoNextPeriod: billable?.scheduledWorkflows ?? null
|
|
47529
|
-
},
|
|
47530
|
-
extractedRows: {
|
|
47531
|
-
limit: quotas.limits.extractedRows,
|
|
47532
|
-
usedThisPeriod: quotas.used.extractedRowsThisPeriod,
|
|
47533
|
-
usedAllTime: quotas.used.extractedRowsAllTime
|
|
47534
|
-
},
|
|
47535
|
-
...billable ? {
|
|
47536
|
-
billableWorkflows: { slotUsage: billable.billableSlotUsage, ...shapeItems(billable.billableWorkflows) },
|
|
47537
|
-
activeWorkflows: { slotUsage: billable.activeSlotUsage, ...shapeItems(billable.activeWorkflows) }
|
|
47538
|
-
} : {},
|
|
47539
|
-
units: {
|
|
47540
|
-
workflowSlots: "slots (weighted: 0.1 simple, 1 standard, 2-10 complex)",
|
|
47541
|
-
extractedRows: "rows",
|
|
47542
|
-
dates: "ISO 8601 UTC"
|
|
47543
|
-
}
|
|
47544
|
-
});
|
|
47545
|
-
}));
|
|
47546
|
-
server.registerTool("get_usage_history", {
|
|
47547
|
-
description: "Daily usage history for the active team (or its organization), one point per UTC day, oldest first. Pick one metric: " + "'active_workflows' = workflows and slots counted by the Active billing rule each day (today's point matches get_usage.workflowSlots.usedActive; older points are an approximation); " + "'billing_period_cumulative' = billable workflows, slots, and extracted rows accumulated since the start of the billing period that contains each day, resetting to zero at each renewal (today's point matches get_usage usedThisPeriod); " + "'daily_activity' = per-day totals of existing workflows, newly approved workflows, and rows extracted that day, informational only and not a billing number. " + "Use for 'how has my usage changed', 'when did slot usage jump', 'rows per day last month'. Use get_usage for the current numbers. Default window is 90 days; maximum 366.",
|
|
47548
|
-
inputSchema: {
|
|
47549
|
-
metric: _enum(["active_workflows", "billing_period_cumulative", "daily_activity"]).describe("Which series to return. See the tool description for what each one measures."),
|
|
47550
|
-
days: preprocess(coerceNumber(), number2().int().min(1).max(366)).optional().describe("Trailing UTC days to return, 1-366 (default 90)."),
|
|
47551
|
-
scope: usageScopeInput
|
|
47552
|
-
},
|
|
47553
|
-
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true }
|
|
47554
|
-
}, withErrorHandling("get_usage_history", async (args) => {
|
|
47555
|
-
const days = args.days ?? 90;
|
|
47556
|
-
const workspace = await ctx.client.usage.resolveWorkspace(usageTeamId(), args.scope ?? "team");
|
|
47557
|
-
const base = {
|
|
47558
|
-
workspace: { id: workspace.workspaceId, type: workspace.workspaceType, name: workspace.name },
|
|
47559
|
-
metric: args.metric,
|
|
47560
|
-
days
|
|
47561
|
-
};
|
|
47562
|
-
if (args.metric === "active_workflows") {
|
|
47563
|
-
const points = (await ctx.client.usage.getActiveSeries(workspace.workspaceId, { days })).map((p) => ({
|
|
47564
|
-
date: p.date,
|
|
47565
|
-
activeWorkflows: p.active,
|
|
47566
|
-
activeSlots: p.activeSlots,
|
|
47567
|
-
active35Days: p.active35
|
|
47568
|
-
}));
|
|
47569
|
-
return jsonResult({
|
|
47570
|
-
...base,
|
|
47571
|
-
units: { activeWorkflows: "workflows", activeSlots: "slots", active35Days: "workflows" },
|
|
47572
|
-
pointCount: points.length,
|
|
47573
|
-
latest: points.at(-1) ?? null,
|
|
47574
|
-
points
|
|
47575
|
-
});
|
|
47576
|
-
}
|
|
47577
|
-
if (args.metric === "billing_period_cumulative") {
|
|
47578
|
-
const points = (await ctx.client.usage.getPeriodSeries(workspace.workspaceId, { days })).map((p) => ({
|
|
47579
|
-
date: p.date,
|
|
47580
|
-
billableWorkflows: p.approved,
|
|
47581
|
-
billableSlots: p.approvedSlots,
|
|
47582
|
-
extractedRows: p.rows
|
|
47583
|
-
}));
|
|
47584
|
-
return jsonResult({
|
|
47585
|
-
...base,
|
|
47586
|
-
units: { billableWorkflows: "workflows since period start", billableSlots: "slots", extractedRows: "rows since period start" },
|
|
47587
|
-
pointCount: points.length,
|
|
47588
|
-
latest: points.at(-1) ?? null,
|
|
47589
|
-
points
|
|
47590
|
-
});
|
|
47591
|
-
}
|
|
47592
|
-
const activity = await ctx.client.usage.getActivityUsage(workspace.workspaceId, { days });
|
|
47593
|
-
const points = activity.days.map((p) => ({
|
|
47594
|
-
date: p.date,
|
|
47595
|
-
totalWorkflows: p.totalWorkflows,
|
|
47596
|
-
approvedWorkflows: p.approvedWorkflows,
|
|
47597
|
-
extractedRows: p.extractedRows
|
|
47598
|
-
}));
|
|
47599
|
-
return jsonResult({
|
|
47600
|
-
...base,
|
|
47601
|
-
range: { start: activity.start, end: activity.end },
|
|
47602
|
-
units: { totalWorkflows: "workflows existing that day", approvedWorkflows: "workflows approved that day", extractedRows: "rows extracted that day" },
|
|
47603
|
-
totals: activity.totals,
|
|
47604
|
-
pointCount: points.length,
|
|
47605
|
-
latest: points.at(-1) ?? null,
|
|
47606
|
-
points
|
|
47607
|
-
});
|
|
47608
|
-
}));
|
|
47609
47440
|
server.registerTool("create_variable", {
|
|
47610
47441
|
description: "Create a new variable. Variables are key-value pairs that can be referenced in workflow prompts using @variableKey syntax. Keys must be unique within the team scope.",
|
|
47611
47442
|
inputSchema: strictSchema({
|
|
@@ -47981,7 +47812,7 @@ function registerTools(server, ctx, capabilities) {
|
|
|
47981
47812
|
});
|
|
47982
47813
|
}));
|
|
47983
47814
|
}
|
|
47984
|
-
var SchemaFieldShape, SchemaValidationAttributionShape, SchemaValidationPresenceRule, SchemaValidationUniquenessRule, SchemaValidationStringLengthRule, SchemaValidationStringFormatRule, SchemaValidationFieldRulesSchema, SchemaValidationRulesSchema, LocationSchema, MonitoringValueOperators, MonitoringValuelessOperators, MonitoringConditionOperatorSchema, MonitoringConditionSchema, MonitoringSchema, RESUMABLE_ASSISTANT_STATUSES, ACTIVE_ASSISTANT_STATUSES, IDLE_ASSISTANT_STATUSES, CLOSED_ASSISTANT_STATUSES, DASHBOARD_BASE_URL = "https://www.kadoa.com", WORKFLOW_AUDIT_WATCHED_KEYS, ACTIVITY_DEFAULT_LIMIT = 25, ACTIVITY_MAX_LIMIT = 200,
|
|
47815
|
+
var SchemaFieldShape, SchemaValidationAttributionShape, SchemaValidationPresenceRule, SchemaValidationUniquenessRule, SchemaValidationStringLengthRule, SchemaValidationStringFormatRule, SchemaValidationFieldRulesSchema, SchemaValidationRulesSchema, LocationSchema, MonitoringValueOperators, MonitoringValuelessOperators, MonitoringConditionOperatorSchema, MonitoringConditionSchema, MonitoringSchema, RESUMABLE_ASSISTANT_STATUSES, ACTIVE_ASSISTANT_STATUSES, IDLE_ASSISTANT_STATUSES, CLOSED_ASSISTANT_STATUSES, DASHBOARD_BASE_URL = "https://www.kadoa.com", WORKFLOW_AUDIT_WATCHED_KEYS, ACTIVITY_DEFAULT_LIMIT = 25, ACTIVITY_MAX_LIMIT = 200, HEALTH_SEVERITY;
|
|
47985
47816
|
var init_tools = __esm(() => {
|
|
47986
47817
|
init_dist2();
|
|
47987
47818
|
init_zod();
|
|
@@ -48179,7 +48010,7 @@ var package_default;
|
|
|
48179
48010
|
var init_package = __esm(() => {
|
|
48180
48011
|
package_default = {
|
|
48181
48012
|
name: "@kadoa/mcp",
|
|
48182
|
-
version: "0.6.
|
|
48013
|
+
version: "0.6.3",
|
|
48183
48014
|
description: "Kadoa MCP Server — manage workflows from Claude Desktop, Cursor, and other MCP clients",
|
|
48184
48015
|
type: "module",
|
|
48185
48016
|
main: "dist/index.js",
|