@2kw/ai-mcp-server 7.3.0-dev.1 → 7.3.0-dev.8
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/tools/extraction.js +31 -0
- package/package.json +1 -1
package/dist/tools/extraction.js
CHANGED
|
@@ -236,6 +236,37 @@ export function register(server, client) {
|
|
|
236
236
|
};
|
|
237
237
|
}
|
|
238
238
|
});
|
|
239
|
+
// ── bulk_rerun_extractions ──────────────────────────────────────────────
|
|
240
|
+
server.tool("2kw_bulk_rerun_extractions", "Queue re-runs of up to 100 extractions, selected either by extractionIds or by a filter (status, schemaVersionId, search) — not both. Each eligible extraction becomes a new PENDING extraction; poll it with 2kw_get_extraction. Extractions still running, vision-only, or whose schema version was deleted are reported as SKIPPED with a reason; unknown IDs as NOT_FOUND.", {
|
|
241
|
+
extractionIds: z.array(z.string()).max(100).optional().describe("Extraction IDs to re-run"),
|
|
242
|
+
status: z
|
|
243
|
+
.enum(["PENDING", "PROCESSING", "COMPLETED", "FAILED"])
|
|
244
|
+
.optional()
|
|
245
|
+
.describe("Re-run extractions with this status, e.g. FAILED"),
|
|
246
|
+
schemaVersionId: z.string().optional().describe("Re-run extractions of this schema version"),
|
|
247
|
+
search: z.string().optional().describe("Re-run extractions whose model contains this text"),
|
|
248
|
+
}, async ({ extractionIds, status, schemaVersionId, search }) => {
|
|
249
|
+
try {
|
|
250
|
+
const { data } = await client.POST("/v1/extractions/rerun", {
|
|
251
|
+
body: { ids: extractionIds, status, schemaVersionId, search },
|
|
252
|
+
});
|
|
253
|
+
const lines = (data?.results ?? []).map((r) => `${r.extractionId}: ${r.outcome}${r.rerunId ? ` -> ${r.rerunId}` : ""}${r.reason ? ` (${r.reason})` : ""}`);
|
|
254
|
+
return {
|
|
255
|
+
content: [
|
|
256
|
+
{
|
|
257
|
+
type: "text",
|
|
258
|
+
text: `Queued ${data?.queued ?? 0}, skipped ${data?.skipped ?? 0}\n${lines.join("\n")}`,
|
|
259
|
+
},
|
|
260
|
+
],
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
catch (error) {
|
|
264
|
+
return {
|
|
265
|
+
content: [{ type: "text", text: formatErrorForMcp(error) }],
|
|
266
|
+
isError: true,
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
});
|
|
239
270
|
}
|
|
240
271
|
function formatExtractionResult(extraction) {
|
|
241
272
|
const parts = [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@2kw/ai-mcp-server",
|
|
3
|
-
"version": "7.3.0-dev.
|
|
3
|
+
"version": "7.3.0-dev.8",
|
|
4
4
|
"description": "MCP server for 2kw.ai — EU-hosted AI platform: OpenAI-compatible LLM gateway, schema-driven document extraction, transcription, agents with a knowledge base, and cost observability. 199 tools for Claude Code, Cursor, and Windsurf.",
|
|
5
5
|
"mcpName": "ai.2kw/mcp-server",
|
|
6
6
|
"keywords": [
|