Skip to content

Custom Context

Fresh

View, search, and create coding standards from your IDE using Greptile's MCP tools. Turn recurring review feedback into enforceable team patterns.

Custom context refers to your team's coding standards that Greptile checks during reviews. Rules like "use async/await instead of promises" or "API endpoints must validate input." When code doesn't follow a pattern, Greptile comments on the PR.

With MCP, you can view, search, and create patterns from your IDE.

View Your Patterns

text
What coding patterns does my organization have?

Tool used: list_custom_context

!List org coding standards with mcp


Search Patterns

text
Search our coding patterns for error handling

Tool used: search_custom_context


Get Pattern Details

text
Show details for pattern 9c29e7ed-2d3f-45bd-846d-a61a59f10dd9

Tool used: get_custom_context

Returns the full pattern including linkedComments-PRs where this pattern triggered feedback.


Create a Pattern

text
Create a coding pattern: "All React components must have TypeScript interfaces for props"
Apply it to .tsx files only.

Tool used: create_custom_context

!Create custom context using the MCP

Scope Examples

You SayPattern Applies To
"Apply everywhere"All files in all repos
"Apply to TypeScript files"**/*.ts
"Apply to the api folder"**/api/**
"Apply to owner/repo only"That specific repository

Disable a Pattern

There's no delete. Set status to inactive:

text
Disable the pattern about console.log statements

Workflow: Turn Recurring Feedback Into a Pattern

When you notice Greptile making the same comment repeatedly:

Identify the pattern

```text theme={}
Search Greptile comments for "error handling"
```

Find comments that keep appearing across PRs.

Create the custom context

```text theme={}
Create a pattern: "All catch blocks must log the error before re-throwing"
Apply to all TypeScript files.
```

Verify it's active

```text theme={}
List my custom contexts and confirm the new pattern is ACTIVE
```

Field Reference

FieldDescription
bodyThe rule text
typeCUSTOM_INSTRUCTION (explicit rule) or PATTERN (code pattern)
statusACTIVE, INACTIVE, or SUGGESTED
scopesWhere it applies (see tools reference for format)
commentsCountTimes this pattern triggered a comment
linkedCommentsPRs where this pattern was applied

Next Steps

Auto-Fix Workflow

Fix comments triggered by your patterns

Tools Reference

Full parameter documentation

Source

Mirrored from the official Greptile documentation. Self-contained reference copy.