loopctl-mcp-server 2.28.0 → 2.30.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.
- package/index.js +91 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1151,6 +1151,32 @@ async function knowledgeAnalyticsTop({ limit, offset, since_days, access_type }
|
|
|
1151
1151
|
return toContent(result);
|
|
1152
1152
|
}
|
|
1153
1153
|
|
|
1154
|
+
async function knowledgeRetrievalMetrics({ limit, offset } = {}) {
|
|
1155
|
+
const params = new URLSearchParams();
|
|
1156
|
+
if (limit != null) params.set("limit", String(limit));
|
|
1157
|
+
if (offset != null) params.set("offset", String(offset));
|
|
1158
|
+
const qs = params.toString();
|
|
1159
|
+
const path = qs
|
|
1160
|
+
? `/api/v1/knowledge/analytics/retrieval-metrics?${qs}`
|
|
1161
|
+
: "/api/v1/knowledge/analytics/retrieval-metrics";
|
|
1162
|
+
const result = await apiCall("GET", path, null, process.env.LOOPCTL_ORCH_KEY);
|
|
1163
|
+
return toContent(result);
|
|
1164
|
+
}
|
|
1165
|
+
|
|
1166
|
+
async function knowledgeCurationLog({ kind, since, limit, offset } = {}) {
|
|
1167
|
+
const params = new URLSearchParams();
|
|
1168
|
+
if (kind) params.set("kind", kind);
|
|
1169
|
+
if (since) params.set("since", since);
|
|
1170
|
+
if (limit != null) params.set("limit", String(limit));
|
|
1171
|
+
if (offset != null) params.set("offset", String(offset));
|
|
1172
|
+
const qs = params.toString();
|
|
1173
|
+
const path = qs
|
|
1174
|
+
? `/api/v1/knowledge/curation-log?${qs}`
|
|
1175
|
+
: "/api/v1/knowledge/curation-log";
|
|
1176
|
+
const result = await apiCall("GET", path, null, process.env.LOOPCTL_ORCH_KEY);
|
|
1177
|
+
return toContent(result);
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1154
1180
|
async function knowledgeArticleStats({ article_id }) {
|
|
1155
1181
|
const result = await apiCall(
|
|
1156
1182
|
"GET",
|
|
@@ -3254,6 +3280,65 @@ const TOOLS = [
|
|
|
3254
3280
|
},
|
|
3255
3281
|
|
|
3256
3282
|
// Knowledge Analytics Tools (orchestrator key)
|
|
3283
|
+
{
|
|
3284
|
+
name: "knowledge_curation_log",
|
|
3285
|
+
description:
|
|
3286
|
+
"The concise, human-readable log of KB CURATION adjustments — novelty-gate decisions " +
|
|
3287
|
+
"(gate_duplicate/gate_draft) and conflict resolutions (supersede/merge/dismiss) — for " +
|
|
3288
|
+
"analyzing the agents'-KB rollout, distinct from the verbose audit log. Each entry is a " +
|
|
3289
|
+
"one-liner: {at, kind, summary, refs, actor, confidence}. RECORDED ONLY while the tenant " +
|
|
3290
|
+
"has the toggle on: settings.kb_curation_log (flip via the admin tenant API, " +
|
|
3291
|
+
"PATCH /api/v1/admin/tenants/:id with settings:{kb_curation_log:true}). Off by default = " +
|
|
3292
|
+
"no rows. Filter by kind and since (ISO8601). Most recent first. Requires orchestrator role.",
|
|
3293
|
+
inputSchema: {
|
|
3294
|
+
type: "object",
|
|
3295
|
+
properties: {
|
|
3296
|
+
kind: {
|
|
3297
|
+
type: "string",
|
|
3298
|
+
description:
|
|
3299
|
+
"Optional: filter by kind (gate_duplicate | gate_draft | supersede | merge | dismiss).",
|
|
3300
|
+
},
|
|
3301
|
+
since: {
|
|
3302
|
+
type: "string",
|
|
3303
|
+
description: "Optional: ISO8601 date or datetime lower bound (inclusive).",
|
|
3304
|
+
},
|
|
3305
|
+
limit: {
|
|
3306
|
+
type: "integer",
|
|
3307
|
+
description: "Events per page (default 50, max 500). Clamped, never rejected.",
|
|
3308
|
+
minimum: 1,
|
|
3309
|
+
maximum: 500,
|
|
3310
|
+
},
|
|
3311
|
+
offset: { type: "integer", description: "Events to skip. Default 0.", minimum: 0 },
|
|
3312
|
+
},
|
|
3313
|
+
required: [],
|
|
3314
|
+
},
|
|
3315
|
+
},
|
|
3316
|
+
{
|
|
3317
|
+
name: "knowledge_retrieval_metrics",
|
|
3318
|
+
description:
|
|
3319
|
+
"Return the daily retrieval-PRECISION time series (agents' KB #3): for each day, the " +
|
|
3320
|
+
"share of search results the agent then opened (search → get/context within a window). " +
|
|
3321
|
+
"A proxy for whether retrieval is improving — watch it trend up as the corpus is " +
|
|
3322
|
+
"de-duplicated, better navigated (MOCs), and conflict-resolved. Most recent day first. " +
|
|
3323
|
+
"Requires orchestrator role.",
|
|
3324
|
+
inputSchema: {
|
|
3325
|
+
type: "object",
|
|
3326
|
+
properties: {
|
|
3327
|
+
limit: {
|
|
3328
|
+
type: "integer",
|
|
3329
|
+
description: "Days per page (default 30, max 365). Clamped, never rejected.",
|
|
3330
|
+
minimum: 1,
|
|
3331
|
+
maximum: 365,
|
|
3332
|
+
},
|
|
3333
|
+
offset: {
|
|
3334
|
+
type: "integer",
|
|
3335
|
+
description: "Days to skip. Default 0.",
|
|
3336
|
+
minimum: 0,
|
|
3337
|
+
},
|
|
3338
|
+
},
|
|
3339
|
+
required: [],
|
|
3340
|
+
},
|
|
3341
|
+
},
|
|
3257
3342
|
{
|
|
3258
3343
|
name: "knowledge_analytics_top",
|
|
3259
3344
|
description:
|
|
@@ -3670,6 +3755,12 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
3670
3755
|
return await knowledgeIngestionJobs();
|
|
3671
3756
|
|
|
3672
3757
|
// Knowledge Analytics Tools
|
|
3758
|
+
case "knowledge_curation_log":
|
|
3759
|
+
return await knowledgeCurationLog(args);
|
|
3760
|
+
|
|
3761
|
+
case "knowledge_retrieval_metrics":
|
|
3762
|
+
return await knowledgeRetrievalMetrics(args);
|
|
3763
|
+
|
|
3673
3764
|
case "knowledge_analytics_top":
|
|
3674
3765
|
return await knowledgeAnalyticsTop(args);
|
|
3675
3766
|
|