viewgate-mcp 1.0.28 → 1.0.30

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 +20 -7
  2. 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 all feedback annotations. Use 'status' to filter (e.g. 'pending,bug_fixing'). WORKFLOW: 1. Read these annotations, 2. Open the source files and apply SURGICAL fixes. 3. Call 'mark_annotation_ready' for EACH ticket. IMPORTANT: Tickets already resolved by the AI in the current sprint are automatically filtered out to prevent redundant work.",
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 to find specific annotations." }
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
  },
@@ -208,7 +208,8 @@ function createMcpServer(apiKey, personalKey) {
208
208
  if (!Array.isArray(rawAnnotations)) {
209
209
  return { content: [{ type: "text", text: "Error: Invalid format from backend" }], isError: true };
210
210
  }
211
- // Local filtering fallback (for older backend versions)
211
+ console.error(`[MCP] Received ${rawAnnotations.length} annotations from backend.`);
212
+ // Local filtering fallback (for older backend versions or additional client-side safety)
212
213
  if (search) {
213
214
  const lowSearch = search.toLowerCase();
214
215
  rawAnnotations = rawAnnotations.filter((ann) => (ann.message && ann.message.toLowerCase().includes(lowSearch)) ||
@@ -216,12 +217,24 @@ function createMcpServer(apiKey, personalKey) {
216
217
  (ann.key && ann.key.toLowerCase().includes(lowSearch)));
217
218
  }
218
219
  if (combinedKey) {
219
- const keyList = combinedKey.split(',').map(k => k.trim());
220
- rawAnnotations = rawAnnotations.filter((ann) => keyList.includes(ann.key) || keyList.includes(ann._id));
220
+ // Normalize keyList for case-insensitive matching and handle VG- prefix
221
+ const keyList = combinedKey.split(',').map(k => k.trim().toUpperCase());
222
+ const baseKeys = keyList.map(k => k.startsWith('VG-') ? k.substring(3) : k);
223
+ rawAnnotations = rawAnnotations.filter((ann) => {
224
+ if (!ann.key)
225
+ return keyList.includes(ann._id);
226
+ const annKeyUpper = ann.key.toUpperCase();
227
+ const annBaseKey = annKeyUpper.startsWith('VG-') ? annKeyUpper.substring(3) : annKeyUpper;
228
+ return keyList.includes(annKeyUpper) ||
229
+ baseKeys.includes(annBaseKey) ||
230
+ keyList.includes(ann._id);
231
+ });
232
+ console.error(`[MCP] Filtered with keys. Remaining: ${rawAnnotations.length}`);
221
233
  }
222
234
  if (idsToFetch) {
223
235
  const idList = idsToFetch.split(',').map(i => i.trim());
224
236
  rawAnnotations = rawAnnotations.filter((ann) => idList.includes(ann._id));
237
+ console.error(`[MCP] Filtered with IDs. Remaining: ${rawAnnotations.length}`);
225
238
  }
226
239
  const priorityMap = { 'urgente': 4, 'urgent': 4, 'alta': 3, 'high': 3, 'media': 2, 'medium': 2, 'baja': 1, 'low': 1 };
227
240
  const sortedAnnotations = rawAnnotations.sort((a, b) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "viewgate-mcp",
3
- "version": "1.0.28",
3
+ "version": "1.0.30",
4
4
  "main": "dist/index.js",
5
5
  "bin": {
6
6
  "viewgate-mcp": "./dist/index.js"