targetprocess-mcp-server 2.2.7 → 2.2.8

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 CHANGED
@@ -45,6 +45,9 @@ Features
45
45
  - `get_feature_user_stories` — Get all user stories for a feature by its ID (id)
46
46
  - `get_not_covered_user_stories_in_feature` — Get user stories in a feature not yet covered by tests, includes `covered` field based on "Test Automation" custom field (id)
47
47
 
48
+ User Stories
49
+ - `get_user_story_bugs` — Get all bugs linked to a user story by its ID (id)
50
+
48
51
  Cards — Read
49
52
  - `get_card_current_status` — Get EntityState, TeamState, and assigned teams for a card (id, optional resourceType: UserStory | Bug | Feature, default: UserStory)
50
53
  - `get_bug_content` — Fetch full content of a bug by ID (id)
package/build/index.js CHANGED
@@ -603,7 +603,7 @@ server.registerTool('create_bug_based_on_card', {
603
603
  CRITICAL WORKFLOW: Before calling this tool, you MUST follow these steps:
604
604
  1) IF you already have user story or bug card content, proceed to step 3 skipping step 2;
605
605
  2) ELSE call "get_user_story_content" tool or "get_bug_content" tool to get user story or bug card content;
606
- 3) format the new bug inside html <div> tags with Issue Description, Steps to Reproduce, Expected Behavior, Actual Behavior sections (note: section titles should be wrapped in <h3> tags, e.g. <h3>Issue Description</h3>);
606
+ 3) format the new bug inside html <div> tags with Environment, Issue Description, Steps to Reproduce, Expected Behavior, Actual Behavior and Attachments sections (note: section titles should be wrapped in <h3> tags, e.g. <h3>Issue Description</h3>);
607
607
  4) IF the user specified a team by name (not ID), call "get_teams" to find the matching team and use its ID as teamId;
608
608
  5) IF the user specified a project by name (not ID), call "get_projects" to find the matching project and use its ID as projectId;
609
609
  6) add a comment to the card with created bug Id and its Title`,
@@ -771,7 +771,7 @@ server.registerTool('create_bug', {
771
771
  description: `Create a new bug card that summarizes the problem in concise, descriptive manner answering questions "What? Where? When?" and content explaining what happened in detail.
772
772
  NOTE: this tool does not require a user story or bug card reference.
773
773
  CRITICAL WORKFLOW: Before calling this tool, you MUST follow these steps:
774
- 1) format the new bug inside html <div> tags with Issue Description, Steps to Reproduce, Expected Behavior, Actual Behavior sections (note: section titles should be wrapped in <h3> tags, e.g. <h3>Issue Description</h3>, step to reproduce should be wrapped in <ol>);
774
+ 1) format the new bug inside html <div> tags with Environment, Issue Description, Steps to Reproduce, Expected Behavior, Actual Behavior and Attachments sections (note: section titles should be wrapped in <h3> tags, e.g. <h3>Issue Description</h3>, step to reproduce should be wrapped in <ol>);
775
775
  2) IF the user specified a team by name (not ID), call "get_teams" to find the matching team and use its ID as teamId;
776
776
  3) IF the user specified a project by name (not ID), call "get_projects" to find the matching project and use its ID as projectId;`,
777
777
  inputSchema: {
@@ -1058,19 +1058,45 @@ server.registerTool('get_feature_user_stories', {
1058
1058
  }],
1059
1059
  };
1060
1060
  }
1061
- const featureItems = items[0].items || [];
1061
+ return {
1062
+ content: [{
1063
+ type: 'text',
1064
+ text: JSON.stringify(items)
1065
+ }],
1066
+ };
1067
+ });
1068
+ server.registerTool('get_user_story_bugs', {
1069
+ title: 'Get user story bugs',
1070
+ description: 'Get bugs linked to a TP user story by its ID',
1071
+ inputSchema: {
1072
+ id: z.string()
1073
+ .min(5)
1074
+ .max(6)
1075
+ .describe('TP user story ID (e.g. 145789)'),
1076
+ },
1077
+ }, async ({ id }) => {
1078
+ const response = await tp.getUserStoryBugs(id);
1079
+ if (!response) {
1080
+ return {
1081
+ content: [{
1082
+ type: 'text',
1083
+ text: `Failed to get bugs for user story id: ${id}`
1084
+ }],
1085
+ };
1086
+ }
1087
+ const items = response.items || [];
1062
1088
  if (items.length === 0) {
1063
1089
  return {
1064
1090
  content: [{
1065
1091
  type: 'text',
1066
- text: `No user stories found for feature id: ${id}`,
1092
+ text: `No bugs found for user story id: ${id}`,
1067
1093
  }],
1068
1094
  };
1069
1095
  }
1070
1096
  return {
1071
1097
  content: [{
1072
1098
  type: 'text',
1073
- text: JSON.stringify(featureItems)
1099
+ text: JSON.stringify(items)
1074
1100
  }],
1075
1101
  };
1076
1102
  });
package/build/tp.js CHANGED
@@ -45,7 +45,6 @@ export class TpClient {
45
45
  async get(params) {
46
46
  params.param["access_token"] = this.token;
47
47
  let _url = this.params(params);
48
- console.error(JSON.stringify({ "TP_URL": _url }, null, 2));
49
48
  try {
50
49
  const response = await fetch(_url, {
51
50
  method: "GET",
@@ -457,6 +456,17 @@ export class TpClient {
457
456
  apiVersion: this.v2
458
457
  });
459
458
  }
459
+ async getUserStoryBugs(userStoryId) {
460
+ return this.get({
461
+ pathParam: ["userstories"],
462
+ param: {
463
+ "format": "json",
464
+ "where": `(id==${userStoryId})`,
465
+ "select": `{bugs}`,
466
+ },
467
+ apiVersion: this.v2
468
+ });
469
+ }
460
470
  async getUserStoriesIdsByFeatureId(featureId) {
461
471
  return this.get({
462
472
  pathParam: ["userstories"],
package/package.json CHANGED
@@ -25,7 +25,7 @@
25
25
  "engines": {
26
26
  "node": ">=20.x"
27
27
  },
28
- "version": "2.2.7",
28
+ "version": "2.2.8",
29
29
  "description": "MCP server for Tartget Process",
30
30
  "main": "build/index.js",
31
31
  "keywords": [