Get root cause analysis

MCP tool reference: get-root-cause-analysis

Overview

The get-root-cause-analysis tool retrieves detailed root cause analyses and fix recommendations for CI failures from CI Autopilot. This tool allows AI assistants to access investigation results and apply fixes directly in your development environment.

Return Type: Structured analysis data with fix recommendations. Structure: issue, root cause, proposed fix

Parameters

Required Parameters

Parameter
Type
Description

repoName

string

Repository name in owner/repo format (e.g., trunk-io/trunk)

Optional Parameters

Parameter
Type
Description

fixId

string

Specific fix identifier from CI Autopilot comment (e.g., FIX-abc123)

prReviewCommentUrl

string

Direct URL to a specific PR comment containing analysis

branch

string

The Git branch name where the CI failure occurred

Getting Parameter Values

If your AI assistant doesn't have direct access to Git information, use these commands:

Get current branch:

git rev-parse --abbrev-ref HEAD

Get repository name:

Look for the repository name in the output (e.g., trunk-io/trunk from [email protected]:trunk-io/trunk.git)

Usage Examples

With Fix ID

With PR Comment URL

Sample Response

Error Handling

Error
Cause
Resolution

Fix {fixId} not found

Invalid or non-existent fix ID

Verify the fix ID from the original CI Autopilot comment

Investigation comment {url} not found

Invalid PR comment URL or no analysis at that URL

Check the URL and ensure it points to a CI Autopilot comment

No failure root causes found for branch {branch}

No analyses exist for the specified branch

Ensure CI has run and failed on this branch, or try a different branch

Either fixId, prReviewCommentUrl, or branch must be provided

Missing required query parameter

Provide at least one of the three query methods

Repository authorization error

Insufficient permissions or invalid repo name

Verify repository name format and your access permissions

No root cause analysis comments found

Query found records but no comment content

CI Autopilot hasn't completed the root cause analysis yet

Last updated