viewgate-mcp 1.0.27 → 1.0.29
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/index.js +14 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -48,16 +48,16 @@ function createMcpServer(apiKey, personalKey) {
|
|
|
48
48
|
tools: [
|
|
49
49
|
{
|
|
50
50
|
name: "get_annotations",
|
|
51
|
-
description: "Retrieves
|
|
51
|
+
description: "Retrieves feedback annotations. You can fetch specific tickets by providing their human keys (e.g., 'VG-XXXX') or internal IDs. By default, it returns pending annotations for the current sprint. WORKFLOW: 1. Fetch annotations, 2. Apply surgical fixes, 3. Mark as ready.",
|
|
52
52
|
inputSchema: {
|
|
53
53
|
type: "object",
|
|
54
54
|
properties: {
|
|
55
|
-
limit: { type: "number", description: "Maximum number of annotations to retrieve (default: 3)", default: 3 },
|
|
55
|
+
limit: { type: "number", description: "Maximum number of annotations to retrieve (default: 3, automatically increased if specific keys are provided)", default: 3 },
|
|
56
56
|
status: { type: "string", description: "Comma-separated list (e.g. 'pending,bug_fixing'). Use 'all' for any state.", default: "pending,bug_fixing" },
|
|
57
57
|
search: { type: "string", description: "Search term to filter by message or file." },
|
|
58
58
|
key: { type: "string", description: "Human key (e.g. VG-XXXX) or comma-separated keys to find specific annotations." },
|
|
59
|
-
keys: { type: "array", items: { type: "string" }, description: "List of human keys to find specific annotations." },
|
|
60
|
-
ids: { type: "string", description: "Comma-separated internal IDs
|
|
59
|
+
keys: { type: "array", items: { type: "string" }, description: "List of human keys (e.g. VG-XXXX) to find specific annotations." },
|
|
60
|
+
ids: { type: "string", description: "Comma-separated internal database IDs." }
|
|
61
61
|
},
|
|
62
62
|
},
|
|
63
63
|
},
|
|
@@ -192,14 +192,17 @@ function createMcpServer(apiKey, personalKey) {
|
|
|
192
192
|
fetchUrl += `&key=${encodeURIComponent(combinedKey)}`;
|
|
193
193
|
if (idsToFetch)
|
|
194
194
|
fetchUrl += `&ids=${encodeURIComponent(idsToFetch)}`;
|
|
195
|
+
console.error(`[MCP] Fetching: ${fetchUrl}`);
|
|
195
196
|
const response = await fetch(fetchUrl, {
|
|
196
197
|
headers: {
|
|
197
198
|
'x-api-key': apiKey,
|
|
198
199
|
...(personalKey ? { 'x-personal-key': personalKey } : {})
|
|
199
200
|
}
|
|
200
201
|
});
|
|
201
|
-
if (!response.ok)
|
|
202
|
-
|
|
202
|
+
if (!response.ok) {
|
|
203
|
+
const errorBody = await response.text();
|
|
204
|
+
throw new Error(`Backend responded with ${response.status}: ${errorBody}`);
|
|
205
|
+
}
|
|
203
206
|
const rawData = (await response.json());
|
|
204
207
|
let rawAnnotations = Array.isArray(rawData) ? rawData : (rawData?.data || rawData?.annotations || []);
|
|
205
208
|
if (!Array.isArray(rawAnnotations)) {
|
|
@@ -268,13 +271,16 @@ Instruction: ${ann.message}`
|
|
|
268
271
|
case "mark_annotation_ready": {
|
|
269
272
|
const args = request.params.arguments;
|
|
270
273
|
console.error(`[MCP] Marking ${args.results.length} annotations as ready.`);
|
|
274
|
+
console.error(`[MCP] Batch ready update: ${BACKEND_URL}/api/mcp/annotations/batch-ready`);
|
|
271
275
|
const response = await fetch(`${BACKEND_URL}/api/mcp/annotations/batch-ready`, {
|
|
272
276
|
method: 'PATCH',
|
|
273
277
|
headers: { 'Content-Type': 'application/json', 'x-api-key': apiKey, ...(personalKey ? { 'x-personal-key': personalKey } : {}) },
|
|
274
278
|
body: JSON.stringify({ results: args.results })
|
|
275
279
|
});
|
|
276
|
-
if (!response.ok)
|
|
277
|
-
|
|
280
|
+
if (!response.ok) {
|
|
281
|
+
const errorBody = await response.text();
|
|
282
|
+
throw new Error(`Backend responded with ${response.status}: ${errorBody}`);
|
|
283
|
+
}
|
|
278
284
|
const result = await response.json();
|
|
279
285
|
return { content: [{ type: "text", text: `Processed: ${JSON.stringify(result, null, 2)}` }] };
|
|
280
286
|
}
|