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
Add get_pull_request_ci_failures tool to retrieve failed CI job logs for PRs
This tool allows AI agents to automatically find and retrieve CI failure logs
for a pull request without manual copy-pasting from the GitHub web UI.
Features:
- Finds workflow runs triggered by a PR using the head SHA
- Identifies failed workflow runs (failure, timed_out, cancelled)
- Collects logs from all failed jobs with failed step information
- Returns log content by default (configurable via return_content)
- Supports tail_lines parameter to limit log output
The tool is added to both pull_requests (default) and actions toolsets.
| Code Security | Code security related tools, such as GitHub Code Scanning |https://api.githubcopilot.com/mcp/x/code_security|[Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-code_security&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fcode_security%22%7D)|[read-only](https://api.githubcopilot.com/mcp/x/code_security/readonly)|[Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-code_security&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fcode_security%2Freadonly%22%7D)|
"description": "Get failed CI workflow job logs for a pull request. This tool finds workflow runs triggered by a PR, identifies failed jobs, and retrieves their logs for debugging CI failures.",
7
+
"inputSchema": {
8
+
"type": "object",
9
+
"required": [
10
+
"owner",
11
+
"repo",
12
+
"pullNumber"
13
+
],
14
+
"properties": {
15
+
"owner": {
16
+
"type": "string",
17
+
"description": "Repository owner"
18
+
},
19
+
"pullNumber": {
20
+
"type": "number",
21
+
"description": "Pull request number"
22
+
},
23
+
"repo": {
24
+
"type": "string",
25
+
"description": "Repository name"
26
+
},
27
+
"return_content": {
28
+
"type": "boolean",
29
+
"description": "Returns actual log content instead of URLs (default: true)",
30
+
"default": true
31
+
},
32
+
"tail_lines": {
33
+
"type": "number",
34
+
"description": "Number of lines to return from the end of each log (default: 500)",
// GetPullRequestCIFailures creates a tool to get failed CI job logs for a pull request
1333
+
funcGetPullRequestCIFailures(getClientGetClientFn, t translations.TranslationHelperFunc, contentWindowSizeint) (mcp.Tool, mcp.ToolHandlerFor[map[string]any, any]) {
1334
+
return mcp.Tool{
1335
+
Name: "get_pull_request_ci_failures",
1336
+
Description: t("TOOL_GET_PR_CI_FAILURES_DESCRIPTION", "Get failed CI workflow job logs for a pull request. This tool finds workflow runs triggered by a PR, identifies failed jobs, and retrieves their logs for debugging CI failures."),
1337
+
Annotations: &mcp.ToolAnnotations{
1338
+
Title: t("TOOL_GET_PR_CI_FAILURES_USER_TITLE", "Get PR CI failures"),
1339
+
ReadOnlyHint: true,
1340
+
},
1341
+
InputSchema: &jsonschema.Schema{
1342
+
Type: "object",
1343
+
Properties: map[string]*jsonschema.Schema{
1344
+
"owner": {
1345
+
Type: "string",
1346
+
Description: DescriptionRepositoryOwner,
1347
+
},
1348
+
"repo": {
1349
+
Type: "string",
1350
+
Description: DescriptionRepositoryName,
1351
+
},
1352
+
"pullNumber": {
1353
+
Type: "number",
1354
+
Description: "Pull request number",
1355
+
},
1356
+
"return_content": {
1357
+
Type: "boolean",
1358
+
Description: "Returns actual log content instead of URLs (default: true)",
1359
+
Default: json.RawMessage(`true`),
1360
+
},
1361
+
"tail_lines": {
1362
+
Type: "number",
1363
+
Description: "Number of lines to return from the end of each log (default: 500)",
0 commit comments