targetprocess-mcp-server 1.0.13 → 1.0.15
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/README.md +1 -4
- package/build/index.js +90 -14
- package/build/tp.js +27 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,13 +25,10 @@ It acts as a **bridge between LLM agents and the Targetprocess API**, providing:
|
|
|
25
25
|
- "Show me currently active release"
|
|
26
26
|
- "write me test cases based on 145322 tp user story"
|
|
27
27
|
- "add a comment to 145155 card saying 'test'"
|
|
28
|
-
|
|
29
28
|
- "write test cases based on 145640 user story"
|
|
30
29
|
- "write detailed test cases based on 145642 user story, format them inside html <div> element and add them as a comment"
|
|
31
|
-
|
|
32
30
|
- "create a bug based on 145637 user story where Add Tile flyout (for a Static Tile) not show"
|
|
33
|
-
|
|
34
|
-
- search for a card with 'Text Element' title
|
|
31
|
+
- "search for a card with 'Text Element' title"
|
|
35
32
|
|
|
36
33
|
---
|
|
37
34
|
## Available tools:
|
package/build/index.js
CHANGED
|
@@ -397,21 +397,34 @@ server.registerTool('get_bug_content', {
|
|
|
397
397
|
}],
|
|
398
398
|
};
|
|
399
399
|
}
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
};
|
|
400
|
+
let bugResult = {
|
|
401
|
+
name: bug.Name,
|
|
402
|
+
id: bug.Id,
|
|
403
|
+
description: '',
|
|
404
|
+
origin: ''
|
|
405
|
+
};
|
|
406
|
+
try {
|
|
407
|
+
const dom = new JSDOM(`<html><body><div id="content">${bug.Description}</div></body></html>`);
|
|
408
|
+
const descriptionText = dom.window.document.getElementById('content')?.textContent;
|
|
409
|
+
if (descriptionText) {
|
|
410
|
+
bugResult.description = descriptionText;
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
catch (error) {
|
|
414
|
+
console.error("Error parsing bug description:", error);
|
|
415
|
+
console.error("Returning bug without description");
|
|
416
|
+
}
|
|
417
|
+
try {
|
|
418
|
+
bugResult.origin = bug.CustomFields?.find((field) => field?.Value === "Origin")?.Value;
|
|
419
|
+
}
|
|
420
|
+
catch (error) {
|
|
421
|
+
console.error("Error parsing bug origin:", error);
|
|
422
|
+
console.error("Returning bug without origin");
|
|
408
423
|
}
|
|
409
|
-
const dom = new JSDOM(`<html><body><div id="content">${description}</div></body></html>`);
|
|
410
|
-
const descriptionText = dom.window.document.getElementById('content')?.textContent;
|
|
411
424
|
return {
|
|
412
425
|
content: [{
|
|
413
426
|
type: 'text',
|
|
414
|
-
text: JSON.stringify(
|
|
427
|
+
text: JSON.stringify(bugResult)
|
|
415
428
|
}],
|
|
416
429
|
};
|
|
417
430
|
});
|
|
@@ -576,7 +589,7 @@ server.registerTool('get_bug_comments', {
|
|
|
576
589
|
}],
|
|
577
590
|
};
|
|
578
591
|
});
|
|
579
|
-
server.registerTool('
|
|
592
|
+
server.registerTool('create_bug_based_on_card', {
|
|
580
593
|
title: 'Create a new bug card based on provided card id',
|
|
581
594
|
description: `Create a new bug card based on provided card id that summarizes the problem in concise,
|
|
582
595
|
descriptive manner answering questions What? Where? When?,
|
|
@@ -602,9 +615,72 @@ server.registerTool('create_bug', {
|
|
|
602
615
|
Be specific and avoid assumptions.
|
|
603
616
|
Clearly outline the actions needed to trigger the bug.
|
|
604
617
|
Number each step so anyone can follow them easily`),
|
|
618
|
+
origin: z.enum([
|
|
619
|
+
"Production - Customer",
|
|
620
|
+
"Production - Internal",
|
|
621
|
+
"Pre-Release - Customer",
|
|
622
|
+
"Pre-Release - Internal",
|
|
623
|
+
"Regression - Dev01",
|
|
624
|
+
"Regression - Team Env",
|
|
625
|
+
"Manual QA",
|
|
626
|
+
"Developer Raised",
|
|
627
|
+
"Operations",
|
|
628
|
+
])
|
|
629
|
+
.default("Manual QA")
|
|
630
|
+
.optional()
|
|
631
|
+
.describe('Where the bug was found, defaults to "Manual QA"'),
|
|
632
|
+
},
|
|
633
|
+
}, async ({ title, card, bugContent, origin }) => {
|
|
634
|
+
const bugResponse = await tp.createBug({ title, card, bugContent, origin });
|
|
635
|
+
if (!bugResponse) {
|
|
636
|
+
return {
|
|
637
|
+
content: [{
|
|
638
|
+
type: 'text',
|
|
639
|
+
text: `Failed to create bug "${title}"\n JSON: ${JSON.stringify(bugResponse, null, 2)}`
|
|
640
|
+
}]
|
|
641
|
+
};
|
|
642
|
+
}
|
|
643
|
+
return {
|
|
644
|
+
content: [{
|
|
645
|
+
type: 'text',
|
|
646
|
+
text: JSON.stringify(bugResponse)
|
|
647
|
+
}],
|
|
648
|
+
};
|
|
649
|
+
});
|
|
650
|
+
server.registerTool('create_bug', {
|
|
651
|
+
title: 'Create a new bug card',
|
|
652
|
+
description: `Create a new bug card that summarizes the problem in concise,
|
|
653
|
+
descriptive manner answering questions What? Where? When?,
|
|
654
|
+
and content explaining what happened in detail.
|
|
655
|
+
CRITICAL WORKFLOW: Before calling this tool, you MUST follow these steps:
|
|
656
|
+
1) format the new bug inside html <div> tags with Issue Description, Steps to Reproduce, Expected Behavior, Actual Behavior;
|
|
657
|
+
2) add a comment to the newly created bug with its Id and Title`,
|
|
658
|
+
inputSchema: {
|
|
659
|
+
title: z.string()
|
|
660
|
+
.describe('Bug card title that summarizes the problem in concise, descriptive, and actionable manner, enabling a developer to understand the issue without opening the report'),
|
|
661
|
+
bugContent: z.string()
|
|
662
|
+
.describe(`Bug description content, explain what happened in detail.
|
|
663
|
+
Include expected behaviour and what actually occurred.
|
|
664
|
+
Be specific and avoid assumptions.
|
|
665
|
+
Clearly outline the actions needed to trigger the bug.
|
|
666
|
+
Number each step so anyone can follow them easily`),
|
|
667
|
+
origin: z.enum([
|
|
668
|
+
"Production - Customer",
|
|
669
|
+
"Production - Internal",
|
|
670
|
+
"Pre-Release - Customer",
|
|
671
|
+
"Pre-Release - Internal",
|
|
672
|
+
"Regression - Dev01",
|
|
673
|
+
"Regression - Team Env",
|
|
674
|
+
"Manual QA",
|
|
675
|
+
"Developer Raised",
|
|
676
|
+
"Operations",
|
|
677
|
+
])
|
|
678
|
+
.default("Manual QA")
|
|
679
|
+
.optional()
|
|
680
|
+
.describe('Where the bug was found, defaults to "Manual QA"'),
|
|
605
681
|
},
|
|
606
|
-
}, async ({ title,
|
|
607
|
-
const bugResponse = await tp.
|
|
682
|
+
}, async ({ title, bugContent, origin }) => {
|
|
683
|
+
const bugResponse = await tp.createBugOnly({ title, bugContent, origin });
|
|
608
684
|
if (!bugResponse) {
|
|
609
685
|
return {
|
|
610
686
|
content: [{
|
package/build/tp.js
CHANGED
|
@@ -12,7 +12,7 @@ export class TpClient {
|
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
14
|
params(params) {
|
|
15
|
-
let _url = this.baseUrl + (params.apiVersion
|
|
15
|
+
let _url = this.baseUrl + (params.apiVersion || this.v1);
|
|
16
16
|
for (const [key, value] of Object.entries(params.pathParam)) {
|
|
17
17
|
_url += value ? `/${key}/${value}` : `/${key}`;
|
|
18
18
|
}
|
|
@@ -85,7 +85,7 @@ export class TpClient {
|
|
|
85
85
|
},
|
|
86
86
|
param: {
|
|
87
87
|
"format": "json",
|
|
88
|
-
}
|
|
88
|
+
},
|
|
89
89
|
});
|
|
90
90
|
return response;
|
|
91
91
|
}
|
|
@@ -96,7 +96,7 @@ export class TpClient {
|
|
|
96
96
|
});
|
|
97
97
|
return response;
|
|
98
98
|
}
|
|
99
|
-
async createBug({ title, card, bugContent }) {
|
|
99
|
+
async createBug({ title, card, bugContent, origin = "Manual QA" }) {
|
|
100
100
|
const bug = {
|
|
101
101
|
"Name": title,
|
|
102
102
|
"Project": {
|
|
@@ -105,7 +105,7 @@ export class TpClient {
|
|
|
105
105
|
"customFields": [{
|
|
106
106
|
"name": "Origin",
|
|
107
107
|
"type": "DropDown",
|
|
108
|
-
"value":
|
|
108
|
+
"value": origin
|
|
109
109
|
}],
|
|
110
110
|
"assignedTeams": [{
|
|
111
111
|
"team": {
|
|
@@ -124,6 +124,29 @@ export class TpClient {
|
|
|
124
124
|
param: { "format": "json" },
|
|
125
125
|
}, bug);
|
|
126
126
|
}
|
|
127
|
+
async createBugOnly({ title, bugContent, origin = "Manual QA" }) {
|
|
128
|
+
const bug = {
|
|
129
|
+
"Name": title,
|
|
130
|
+
"Project": {
|
|
131
|
+
"Id": config.tp.projectId
|
|
132
|
+
},
|
|
133
|
+
"customFields": [{
|
|
134
|
+
"name": "Origin",
|
|
135
|
+
"type": "DropDown",
|
|
136
|
+
"value": origin
|
|
137
|
+
}],
|
|
138
|
+
"assignedTeams": [{
|
|
139
|
+
"team": {
|
|
140
|
+
"id": config.tp.teamId
|
|
141
|
+
}
|
|
142
|
+
}],
|
|
143
|
+
"Description": bugContent,
|
|
144
|
+
};
|
|
145
|
+
return this.post({
|
|
146
|
+
pathParam: { "bugs": '' },
|
|
147
|
+
param: { "format": "json" },
|
|
148
|
+
}, bug);
|
|
149
|
+
}
|
|
127
150
|
async createBugBasedOnUserStory(title, userStoryId, bugContent) {
|
|
128
151
|
const bug = {
|
|
129
152
|
"Name": title,
|