You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/mcp-provider-devops/src/tools/sfDevopsResolveDeploymentFailure.ts
+34-17Lines changed: 34 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -9,9 +9,8 @@ const inputSchema = z.object({
9
9
usernameOrAlias: usernameOrAliasParam,
10
10
workItemName: z.string().min(1).describe("Work Item name (mandatory). Exact name of the work item that failed deployment."),
11
11
sourceBranchName: z.string().min(1).describe("Source branch name (mandatory). The work item branch where the change lives."),
12
-
targetBranchName: z.string().min(1).optional().describe("Target branch name (optional). When provided with localPath, the tool compares source and target to determine if the missing dependency is in source but not in target, confirming full promotion will resolve the failure."),
13
12
errorDetails: z.string().min(1).describe("Error details from the failed deployment (mandatory). Used to determine if full promotion can fix the failure."),
14
-
localPath: z.string().optional().describe("Local path to the repository (defaults to current working directory)")
13
+
localPath: z.string().optional().describe("Local path to the repository (optional). Required only for dependency-type errors: used to check if the source branch contains the missing dependency. If provided and valid, the tool checks the branch; if dependency is present, full promotion can fix.")
15
14
});
16
15
typeInputArgs=z.infer<typeofinputSchema>;
17
16
typeInputArgsShape=typeofinputSchema.shape;
@@ -42,12 +41,12 @@ export class SfDevopsResolveDeploymentFailure extends McpTool<InputArgsShape, Ou
42
41
title: "Resolve Deployment Failure",
43
42
description: `Determine if **full promotion** can fix a deployment failure and guide the user.
44
43
45
-
**Inputs:** workItemName (mandatory), sourceBranchName (mandatory), errorDetails (mandatory), localPath (optional; defaults to current working directory), targetBranchName (optional; when provided, source and target are compared to confirm if full promotion will resolve).
1. **If full promotion cannot fix** (e.g. merge conflict): Return instructions to use **resolve_devops_center_merge_conflict** or to add the missing dependency in a separate work item.
49
48
2. **If full promotion can fix** (anything other than merge conflict):
50
-
- For dependency-type errors (e.g. "Variable does not exist"): Use **localPath** to check whether the missing dependency exists in the source branch. If **targetBranchName** is provided, the tool compares source and target (dependency in source but not in target → full promotion will resolve). If **present in source** → ask the user for confirmation (see below). If **not present in source** → instruct the user to create a new work item for the missing dependency, promote it first, then retry.
49
+
- For dependency-type errors (e.g. "Variable does not exist"): If **localPath** is not provided, ask the user for the local path of the source branch. If provided, check whether the missing dependency exists in the source branch. If **present** → ask the user for confirmation (see below). If **not present** → instruct the user to create a new work item for the missing dependency, promote it first, then retry.
51
50
- For other errors: Ask the user for confirmation (see below).
52
51
53
52
**MANDATORY – Ask for confirmation; do NOT run full promotion without it:**
@@ -60,13 +59,20 @@ export class SfDevopsResolveDeploymentFailure extends McpTool<InputArgsShape, Ou
text: `The error suggests a missing dependency${missingDependencyName ? ` (e.g. ${missingDependencyName})` : ""}. To see if full promotion can fix it, the tool must check whether that dependency exists in the source branch.
96
+
97
+
**Please provide the local path** to your repo (**localPath**). The tool will check branch "${input.sourceBranchName}":
98
+
- If the dependency is in the branch → full promotion can fix (you'll be asked to confirm).
99
+
- If not → create a new work item for the missing dependency, promote it first, then retry "${input.workItemName}".
100
+
101
+
If you cannot provide a path, create a new work item that adds the missing dependency, promote it, then retry.`
? ` The missing dependency "${missingDependencyName}" is in source branch "${input.sourceBranchName}" but not in target branch "${input.targetBranchName}"; full promotion will resolve this.`
113
-
: ` The dependency "${missingDependencyName}" is present in both source and target branches; full promotion will resolve.`
114
-
: "";
115
132
return{
116
133
content: [{
117
134
type: "text",
118
-
text: `**Full promotion can resolve this failure** based on the error details.${comparisonNote}
135
+
text: `**Full promotion can resolve this failure** based on the error details.
119
136
120
137
**Ask for confirmation:** Do not run full promotion until the user explicitly confirms. Present this to the user:
0 commit comments