Skip to main content
Greptile logo

Overview

Add Greptile to any ModuleX agent or workflow. AI-powered codebase search and Q&A against the Greptile v2 REST API (api.greptile.com). Query and search codebases using natural language, get AI-generated answers about your code with cited file references, index repositories, and check indexing status.
Categories: Developer Tools & Infrastructure · Version Control · Knowledge Base · Auth: API Key · Actions: 4

Authentication

API Key Authentication

Authenticate using your Greptile API key plus a GitHub Personal Access Token so Greptile can access your repositories
1

Step 1

Go to https://app.greptile.com and sign up or log in
2

Step 2

Open Settings and create a new API key
3

Step 3

Paste the Greptile API key below
4

Step 4

Create a GitHub Personal Access Token with ‘repo’ read access at https://github.com/settings/tokens and paste it as the GitHub token

Required Credentials

FieldDescriptionRequiredFormat
Greptile API KeyYour Greptile API key from app.greptile.comYes-
GitHub TokenA GitHub Personal Access Token with ‘repo’ read access, used by Greptile to clone and index your repositoriesYes-

Available Actions

Parameters

query
string
required
Natural language question about the codebase
repositories
string
required
Comma-separated list of repositories. Format: ‘github:branch:owner/repo’ or just ‘owner/repo’ (defaults to github:main). Example: ‘facebook/react’ or ‘github:main:facebook/react,github:main:facebook/relay’
session_id
string
Optional session ID for conversation continuity across multiple queries
genius
boolean
Enable genius mode for more thorough analysis (slower but more accurate)

Response

{
  "$defs": {
    "QuerySource": {
      "additionalProperties": false,
      "description": "A single code reference returned by ``query`` and ``search``.",
      "properties": {
        "repository": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Repository"
        },
        "remote": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Remote"
        },
        "branch": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Branch"
        },
        "filepath": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Filepath"
        },
        "linestart": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Linestart"
        },
        "lineend": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Lineend"
        },
        "summary": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Summary"
        },
        "distance": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Distance"
        }
      },
      "title": "QuerySource",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "message": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Message"
    },
    "sources": {
      "items": {
        "$ref": "#/$defs/QuerySource"
      },
      "title": "Sources",
      "type": "array"
    }
  },
  "required": [
    "success"
  ],
  "title": "QueryOutput",
  "type": "object"
}

Parameters

query
string
required
Natural language search query to find relevant code
repositories
string
required
Comma-separated list of repositories. Format: ‘github:branch:owner/repo’ or just ‘owner/repo’ (defaults to github:main). Example: ‘facebook/react’ or ‘github:main:facebook/react,github:main:facebook/relay’
session_id
string
Optional session ID for conversation continuity across multiple searches
genius
boolean
Enable genius mode for more thorough search (slower but more accurate)

Response

{
  "$defs": {
    "QuerySource": {
      "additionalProperties": false,
      "description": "A single code reference returned by ``query`` and ``search``.",
      "properties": {
        "repository": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Repository"
        },
        "remote": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Remote"
        },
        "branch": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Branch"
        },
        "filepath": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Filepath"
        },
        "linestart": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Linestart"
        },
        "lineend": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Lineend"
        },
        "summary": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Summary"
        },
        "distance": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Distance"
        }
      },
      "title": "QuerySource",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "sources": {
      "items": {
        "$ref": "#/$defs/QuerySource"
      },
      "title": "Sources",
      "type": "array"
    }
  },
  "required": [
    "success"
  ],
  "title": "SearchOutput",
  "type": "object"
}

Parameters

remote
string
required
Git remote type: ‘github’ or ‘gitlab’ (Default: github)
repository
string
required
Repository in owner/repo format. Example: ‘facebook/react’
branch
string
required
Branch to index (e.g. ‘main’ or ‘master’)
reload
boolean
Force re-indexing even if already indexed
notify
boolean
Send email notification when indexing completes

Response

{
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "repository_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Repository Id"
    },
    "status_endpoint": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Status Endpoint"
    },
    "message": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Message"
    }
  },
  "required": [
    "success"
  ],
  "title": "IndexRepositoryOutput",
  "type": "object"
}

Parameters

remote
string
required
Git remote type: ‘github’ or ‘gitlab’ (Default: github)
repository
string
required
Repository in owner/repo format. Example: ‘facebook/react’
branch
string
required
Branch name (e.g. ‘main’ or ‘master’)

Response

{
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "repository": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Repository"
    },
    "remote": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Remote"
    },
    "branch": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Branch"
    },
    "private": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Private"
    },
    "status": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Status"
    },
    "files_processed": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Files Processed"
    },
    "num_files": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Num Files"
    },
    "sample_questions": {
      "items": {
        "type": "string"
      },
      "title": "Sample Questions",
      "type": "array"
    },
    "sha": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Sha"
    },
    "raw": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Raw"
    }
  },
  "required": [
    "success"
  ],
  "title": "StatusOutput",
  "type": "object"
}

Limits & Quotas

  • Indexing is asynchronous: small repositories take 3–5 minutes, larger ones can take over an hour. Use index_repo to start indexing, then poll status until it reports completed.
  • Error model: non-2xx responses and timeouts are caught and returned as success=False + error rather than raising. Plan retries on the agent side based on the error string.

GitHub

GitLab

Airweave