@bbearai/mcp-server 0.3.4 → 0.5.1
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-api.js +45 -0
- package/dist/index.js +694 -25
- package/package.json +1 -1
- package/src/index-api.ts +46 -1
- package/src/index.ts +786 -25
package/package.json
CHANGED
package/src/index-api.ts
CHANGED
|
@@ -40,7 +40,7 @@ function validateConfig() {
|
|
|
40
40
|
// API helper
|
|
41
41
|
async function apiRequest(
|
|
42
42
|
endpoint: string,
|
|
43
|
-
method: 'GET' | 'POST' | 'PATCH' = 'GET',
|
|
43
|
+
method: 'GET' | 'POST' | 'PATCH' | 'DELETE' = 'GET',
|
|
44
44
|
body?: Record<string, unknown>
|
|
45
45
|
): Promise<{ data?: unknown; error?: string }> {
|
|
46
46
|
try {
|
|
@@ -241,6 +241,33 @@ const tools = [
|
|
|
241
241
|
required: ['test_key', 'title', 'steps', 'expected_result'],
|
|
242
242
|
},
|
|
243
243
|
},
|
|
244
|
+
{
|
|
245
|
+
name: 'delete_test_cases',
|
|
246
|
+
description: 'Delete one or more test cases. Supports single delete by ID or test_key, or bulk delete with arrays (max 50). WARNING: cascade-deletes associated test_assignments, test_feedback, and ai_test_runs.',
|
|
247
|
+
inputSchema: {
|
|
248
|
+
type: 'object' as const,
|
|
249
|
+
properties: {
|
|
250
|
+
test_case_id: {
|
|
251
|
+
type: 'string',
|
|
252
|
+
description: 'UUID of a single test case to delete',
|
|
253
|
+
},
|
|
254
|
+
test_key: {
|
|
255
|
+
type: 'string',
|
|
256
|
+
description: 'Delete a single test case by test_key (e.g., TC-001)',
|
|
257
|
+
},
|
|
258
|
+
test_case_ids: {
|
|
259
|
+
type: 'array',
|
|
260
|
+
items: { type: 'string' },
|
|
261
|
+
description: 'Array of test case UUIDs to bulk delete (max 50)',
|
|
262
|
+
},
|
|
263
|
+
test_keys: {
|
|
264
|
+
type: 'array',
|
|
265
|
+
items: { type: 'string' },
|
|
266
|
+
description: 'Array of test_keys to bulk delete (max 50)',
|
|
267
|
+
},
|
|
268
|
+
},
|
|
269
|
+
},
|
|
270
|
+
},
|
|
244
271
|
{
|
|
245
272
|
name: 'get_qa_tracks',
|
|
246
273
|
description: 'Get QA tracks for the project',
|
|
@@ -340,6 +367,24 @@ async function handleTool(
|
|
|
340
367
|
});
|
|
341
368
|
break;
|
|
342
369
|
|
|
370
|
+
case 'delete_test_cases': {
|
|
371
|
+
const ids = args.test_case_ids as string[] || (args.test_case_id ? [args.test_case_id as string] : undefined);
|
|
372
|
+
const keys = args.test_keys as string[] || (args.test_key ? [args.test_key as string] : undefined);
|
|
373
|
+
|
|
374
|
+
if (ids) {
|
|
375
|
+
const params = new URLSearchParams();
|
|
376
|
+
ids.forEach((id: string) => params.append('ids', id));
|
|
377
|
+
result = await apiRequest(`/test-cases?${params.toString()}`, 'DELETE');
|
|
378
|
+
} else if (keys) {
|
|
379
|
+
const params = new URLSearchParams();
|
|
380
|
+
keys.forEach((k: string) => params.append('keys', k));
|
|
381
|
+
result = await apiRequest(`/test-cases?${params.toString()}`, 'DELETE');
|
|
382
|
+
} else {
|
|
383
|
+
result = { error: 'Must provide test_case_id, test_key, test_case_ids, or test_keys' };
|
|
384
|
+
}
|
|
385
|
+
break;
|
|
386
|
+
}
|
|
387
|
+
|
|
343
388
|
case 'get_qa_tracks':
|
|
344
389
|
result = await apiRequest('/qa-tracks');
|
|
345
390
|
break;
|