-
Notifications
You must be signed in to change notification settings - Fork 58
Expand file tree
/
Copy pathtest-check-tags.js
More file actions
51 lines (45 loc) · 1.19 KB
/
test-check-tags.js
File metadata and controls
51 lines (45 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
const axios = require('axios');
async function mcpRequest(method, params = {}) {
const response = await axios.post('http://localhost:3456/mcp', {
jsonrpc: '2.0',
id: Date.now(),
method,
params
});
return response.data.result;
}
async function callTool(toolName, args) {
const result = await mcpRequest('tools/call', {
name: toolName,
arguments: args
});
if (result.content && result.content[0]) {
try {
return JSON.parse(result.content[0].text);
} catch (e) {
return result.content[0].text;
}
}
return result;
}
async function test() {
const tagsResponse = await callTool('get_tags', {});
const tags = tagsResponse.data || tagsResponse;
console.log('\nExisting tags:');
tags.forEach(tag => {
console.log(` - ${tag.name} (${tag.id})`);
});
// Delete E2E test tags
console.log('\nDeleting E2E test tags...');
for (const tag of tags) {
if (tag.name.includes('E2E Test')) {
try {
await callTool('delete_tag', { id: tag.id });
console.log(` ✅ Deleted: ${tag.name}`);
} catch (error) {
console.log(` ❌ Failed to delete: ${tag.name}`);
}
}
}
}
test().catch(console.error);