@2kw/ai-mcp-server 6.2.0-dev.42 → 6.2.0-dev.49
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/agents.js +61 -0
- package/package.json +1 -1
package/dist/tools/agents.js
CHANGED
|
@@ -69,6 +69,36 @@ export function register(server, client) {
|
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
71
|
});
|
|
72
|
+
// ── list_agent_catalog ──────────────────────────────────────────────────
|
|
73
|
+
server.tool("2kw_list_agent_catalog", "List published agents as id, name and description. This is the read a chat-only USER "
|
|
74
|
+
+ "key may perform; 2kw_list_agents carries the operator configuration and needs VIEWER or above.", {
|
|
75
|
+
search: z.string().optional().describe("Filter agents by name"),
|
|
76
|
+
page: z.number().optional().default(0).describe("Page number (0-based)"),
|
|
77
|
+
size: z.number().optional().default(20).describe("Page size"),
|
|
78
|
+
}, async ({ search, page, size }) => {
|
|
79
|
+
try {
|
|
80
|
+
// No sort parameter: the catalog is always name-ascending (#814).
|
|
81
|
+
const { data } = await client.GET("/v1/agents/catalog", {
|
|
82
|
+
params: { query: { search, pageable: { page, size } } },
|
|
83
|
+
});
|
|
84
|
+
const result = data;
|
|
85
|
+
const lines = (result.content ?? []).map((a) => `- ${a.name} (id: ${a.id})${a.description ? ` — ${a.description}` : ""}`);
|
|
86
|
+
return {
|
|
87
|
+
content: [
|
|
88
|
+
{
|
|
89
|
+
type: "text",
|
|
90
|
+
text: `Published agents (${result.totalElements} total, page ${(result.number ?? 0) + 1}/${result.totalPages}):\n${lines.join("\n") || "(none)"}`,
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
catch (error) {
|
|
96
|
+
return {
|
|
97
|
+
content: [{ type: "text", text: formatErrorForMcp(error) }],
|
|
98
|
+
isError: true,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
});
|
|
72
102
|
// ── get_agent ───────────────────────────────────────────────────────────
|
|
73
103
|
server.tool("2kw_get_agent", "Get an agent by its ID.", { agentId: z.string().describe("The agent ID") }, async ({ agentId }) => {
|
|
74
104
|
try {
|
|
@@ -291,6 +321,37 @@ export function register(server, client) {
|
|
|
291
321
|
};
|
|
292
322
|
}
|
|
293
323
|
});
|
|
324
|
+
// ── get_agent_version_policy ────────────────────────────────────────────
|
|
325
|
+
server.tool("2kw_get_agent_version_policy", "What the policy gate would do to a call of each tool an agent version configures: the verdict (EXECUTE, RELAY, PAUSE_APPROVAL, JUDGE, BLOCK, FAIL), the composed action, the class and where it came from, and every policy statement behind it. Read-only — no run, no approval row, no judge call. Answers 'what happens if this agent calls that tool' without running the agent.", {
|
|
326
|
+
agentId: z.string().describe("The agent ID"),
|
|
327
|
+
versionId: z.string().describe("The agent version ID"),
|
|
328
|
+
tool: z
|
|
329
|
+
.string()
|
|
330
|
+
.optional()
|
|
331
|
+
.describe("Answer for this tool only; omit for every tool the version configures"),
|
|
332
|
+
installationId: z
|
|
333
|
+
.string()
|
|
334
|
+
.optional()
|
|
335
|
+
.describe("Resolve this installation's module tool catalog, the way a run of that installation would. Omit to answer for the agent's own tools only."),
|
|
336
|
+
}, async ({ agentId, versionId, tool, installationId }) => {
|
|
337
|
+
try {
|
|
338
|
+
const { data } = await client.GET("/v1/agents/{agentId}/versions/{versionId}/policy", {
|
|
339
|
+
params: {
|
|
340
|
+
path: { agentId, versionId },
|
|
341
|
+
query: { tool, installation: installationId },
|
|
342
|
+
},
|
|
343
|
+
});
|
|
344
|
+
return {
|
|
345
|
+
content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
catch (error) {
|
|
349
|
+
return {
|
|
350
|
+
content: [{ type: "text", text: formatErrorForMcp(error) }],
|
|
351
|
+
isError: true,
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
});
|
|
294
355
|
// ── deactivate_agent_version ────────────────────────────────────────────
|
|
295
356
|
server.tool("2kw_deactivate_agent_version", "Soft-delete an agent version.", {
|
|
296
357
|
agentId: z.string().describe("The agent ID"),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@2kw/ai-mcp-server",
|
|
3
|
-
"version": "6.2.0-dev.
|
|
3
|
+
"version": "6.2.0-dev.49",
|
|
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. 158 tools for Claude Code, Cursor, and Windsurf.",
|
|
5
5
|
"mcpName": "ai.2kw/mcp-server",
|
|
6
6
|
"keywords": [
|