viewgate-mcp 1.0.2 → 1.0.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.
Files changed (2) hide show
  1. package/dist/index.js +71 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -69,6 +69,35 @@ function createMcpServer(apiKey) {
69
69
  },
70
70
  required: ["id", "originalMessage", "appliedChanges"]
71
71
  },
72
+ },
73
+ {
74
+ name: "planning",
75
+ description: "Planning tool for backlog tickets. CALL WITHOUT ARGUMENTS to fetch backlog tickets that need analysis. CALL WITH 'results' to submit AI analysis in batch. Rules: complejidad (1-3), incertidumbre (1-3), impacto (1-3), riesgo (1-3), tipo (AI-friendly|AI-assisted|Human-critical).",
76
+ inputSchema: {
77
+ type: "object",
78
+ properties: {
79
+ results: {
80
+ type: "array",
81
+ items: {
82
+ type: "object",
83
+ properties: {
84
+ id: { type: "string", description: "The ticket/annotation ID" },
85
+ complejidad: { type: "number", minimum: 1, maximum: 3 },
86
+ incertidumbre: { type: "number", minimum: 1, maximum: 3 },
87
+ impacto: { type: "number", minimum: 1, maximum: 3 },
88
+ riesgo: { type: "number", minimum: 1, maximum: 3 },
89
+ tipo: { type: "string", enum: ["AI-friendly", "AI-assisted", "Human-critical"] },
90
+ aiAnalysis: { type: "string", description: "Reasoning or summary of the analysis" }
91
+ },
92
+ required: ["id", "complejidad", "incertidumbre", "impacto", "riesgo", "tipo", "aiAnalysis"]
93
+ }
94
+ },
95
+ force: {
96
+ type: "boolean",
97
+ description: "If true, overwrites existing planning data."
98
+ }
99
+ }
100
+ }
72
101
  }
73
102
  ],
74
103
  };
@@ -188,6 +217,48 @@ function createMcpServer(apiKey) {
188
217
  };
189
218
  }
190
219
  }
220
+ case "planning": {
221
+ try {
222
+ const args = request.params.arguments;
223
+ if (!args.results) {
224
+ // Fetch Backlog Mode
225
+ const response = await fetch(`${BACKEND_URL}/api/mcp/backlog`, {
226
+ headers: { 'x-api-key': apiKey }
227
+ });
228
+ if (!response.ok) {
229
+ throw new Error(`Backend responded with ${response.status}`);
230
+ }
231
+ const data = (await response.json());
232
+ return {
233
+ content: [{ type: "text", text: JSON.stringify(data.data || [], null, 2) }]
234
+ };
235
+ }
236
+ else {
237
+ // Submit Results Mode
238
+ const response = await fetch(`${BACKEND_URL}/api/mcp/annotations/batch-planning`, {
239
+ method: 'PATCH',
240
+ headers: {
241
+ 'Content-Type': 'application/json',
242
+ 'x-api-key': apiKey
243
+ },
244
+ body: JSON.stringify({ results: args.results, force: args.force })
245
+ });
246
+ if (!response.ok) {
247
+ throw new Error(`Backend responded with ${response.status}`);
248
+ }
249
+ const result = await response.json();
250
+ return {
251
+ content: [{ type: "text", text: `Planning results processed: ${JSON.stringify(result, null, 2)}` }]
252
+ };
253
+ }
254
+ }
255
+ catch (error) {
256
+ return {
257
+ content: [{ type: "text", text: `Error in planning tool: ${error.message}` }],
258
+ isError: true
259
+ };
260
+ }
261
+ }
191
262
  default:
192
263
  throw new Error("Unknown tool");
193
264
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "viewgate-mcp",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "main": "dist/index.js",
5
5
  "bin": {
6
6
  "viewgate-mcp": "./dist/index.js"