> ## Documentation Index
> Fetch the complete documentation index at: https://www.greptile.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Auto-Fix Workflow

> Fix Greptile code review comments directly from your IDE using MCP tools. Fetch unaddressed issues, apply suggested fixes, and track resolution progress.

Use Greptile MCP tools to fetch unaddressed comments and apply fixes directly from your IDE.

<Note>
  **Prerequisite:** [Configure MCP in your IDE](/mcp-v2/setup) before following these workflows.
</Note>

<Tip>
  **Using Claude Code?** [Agent skills](/mcp-v2/skills) automate the entire auto-fix loop for you. Run `/check-pr` to fix all review comments on a PR, or `/greploop` to iterate until Greptile gives a 5/5 confidence score.
</Tip>

## Your First Auto-Fix

<Steps>
  <Step title="Fetch unaddressed comments">
    Ask your AI assistant:

    ```text theme={}
    List unaddressed Greptile comments for PR #5 in owner/repo
    ```

    The assistant calls `list_merge_request_comments` with `addressed: false`.

    <Frame>
      <img src="https://mintcdn.com/greptile/sJeefWhR1h6iqsSa/images/unaddressed-pr-comments.png?fit=max&auto=format&n=sJeefWhR1h6iqsSa&q=85&s=114391f9a32f37cd78fd2caf0728af39" alt="Unaddressed PR comments" width="846" height="489" data-path="images/unaddressed-pr-comments.png" />
    </Frame>
  </Step>

  <Step title="Review the response">
    You'll see comments with their details including file path, issue type, and whether a fix is available.
  </Step>

  <Step title="Apply fixes">
    For comments with `hasSuggestion: true`:

    ```text theme={}
    Apply the suggested fix for the API token issue
    ```

    The assistant applies the `suggestedCode` to your file.

    <Frame>
      <img src="https://mintcdn.com/greptile/pPDrEYn7_-Bi_2Mg/images/cursor-code-changes.png?fit=max&auto=format&n=pPDrEYn7_-Bi_2Mg&q=85&s=981de2dc2c1697c6f881907875d6d94e" alt="Code changes for review" width="864" height="563" data-path="images/cursor-code-changes.png" />
    </Frame>
  </Step>

  <Step title="Accept changes">
    Review the changes, then click **Keep All** to apply them to your codebase.
  </Step>

  <Step title="Commit changes">
    After applying fixes, commit your changes. Greptile automatically marks comments as addressed when the file is modified.
  </Step>
</Steps>

***

## Understanding Comment Fields

When you fetch comments, each one includes these key fields:

| Field                   | Type    | Description                                   |
| ----------------------- | ------- | --------------------------------------------- |
| `isGreptileComment`     | boolean | `true` if from Greptile                       |
| `addressed`             | boolean | `true` if resolved by subsequent commit       |
| `hasSuggestion`         | boolean | `true` if includes a code fix                 |
| `suggestedCode`         | string  | The actual fix (when `hasSuggestion` is true) |
| `filePath`              | string  | File location (null for PR-level comments)    |
| `lineStart` / `lineEnd` | number  | Line range (null for general comments)        |
| `linkedMemory`          | object  | Custom context that triggered this comment    |

### How Comments Get "Addressed"

A comment becomes addressed when there's a **commit after the comment** that modifies the relevant file:

```text theme={}
1. Greptile comments on src/auth.ts
2. Developer pushes commit touching src/auth.ts  
3. Comment marked as addressed: true
```

Check progress via `reviewAnalysis.reviewCompleteness` (e.g., "2/5 Greptile comments addressed").

***

## Common Prompts

<AccordionGroup>
  <Accordion title="Get all comments with fixes">
    ```text theme={}
    List all Greptile comments on PR #5 that have suggested code fixes
    ```

    The assistant filters for `hasSuggestion: true`.
  </Accordion>

  <Accordion title="Fix style issues only">
    ```text theme={}
    Find Greptile comments about style or formatting and apply the fixes
    ```

    Searches comment bodies for style-related keywords.
  </Accordion>

  <Accordion title="Check if PR is ready to merge">
    ```text theme={}
    What's the review status for PR #5? Are there any unaddressed critical issues?
    ```

    Uses `get_merge_request` and checks `reviewAnalysis.reviewCompleteness`.
  </Accordion>

  <Accordion title="Get comments for specific file">
    ```text theme={}
    Show Greptile comments for src/auth/login.ts
    ```

    Filters results by `filePath`.
  </Accordion>

  <Accordion title="See what custom context triggered a comment">
    ```text theme={}
    Why did Greptile flag this issue? Show the linked coding pattern.
    ```

    Checks the `linkedMemory` field for the associated custom context.
  </Accordion>
</AccordionGroup>

***

## Next Steps

<CardGroup cols={3}>
  <Card title="Agent Skills" icon="robot" href="/mcp-v2/skills">
    Automate the full auto-fix loop with `/check-pr` and `/greploop`
  </Card>

  <Card title="Custom Context" icon="brain" href="/mcp-v2/custom-context">
    Learn how `linkedMemory` connects comments to your patterns
  </Card>

  <Card title="Tools Reference" icon="book" href="/mcp-v2/tools">
    Complete field documentation for all responses
  </Card>
</CardGroup>
