This tool essentially enables AI agents to understand and interact with codebases, making it easier for them to provide code-related assistance and insights.
Tools
index_repository
Index a repository for code search and querying. This tool initiates the processing of a repository, making it available for future queries. A repository must be indexed before it can be queried or searched. Args: ctx: The MCP server provided context which includes the Greptile client remote: The repository host, either "github" or "gitlab" repository: The repository in owner/repo format (e.g., "coleam00/mcp-mem0") branch: The branch to index (e.g., "main") reload: Whether to force reprocessing of the repository (default: False) notify: Whether to send an email notification when indexing is complete (default: False)
query_repository
Query repositories to get an answer with code references. Supports both single-turn and multi-turn (conversational) context. Args: ctx: MCP server provided context query: The natural language query about the codebase repositories: List of repositories to query session_id: Used for multi-turn conversations; generates new if not provided stream: Enable streaming for long queries (returns async generator) genius: Use enhanced answer quality (may take longer) timeout: Optional per-query timeout (seconds) previous_messages: Optional prior conversation messages for this session Returns: - For streaming: async generator yielding JSON strings. - For non-streaming: formatted JSON string (single result).
search_repository
Search repositories for relevant files without generating a full answer. This tool returns a list of relevant files based on a query without generating a complete answer. The repositories must have been indexed first. Args: ctx: The MCP server provided context which includes the Greptile client query: The natural language query about the codebase repositories: List of repositories to search, each with format {"remote": "github", "repository": "owner/repo", "branch": "main"} session_id: Optional session ID for continuing a conversation genius: Whether to use the enhanced search capabilities (default: True)
get_repository_info
Get information about an indexed repository. This tool retrieves information about a specific repository that has been indexed, including its status and other metadata. The tool handles proper URL encoding internally to ensure repository identifiers with special characters (like '/') are correctly processed. Args: ctx: The MCP server provided context which includes the Greptile client remote: The repository host, either "github" or "gitlab" repository: The repository in owner/repo format (e.g., "coleam00/mcp-mem0") branch: The branch that was indexed (e.g., "main") Returns: A JSON string containing repository information such as status, last indexed time, and other metadata. If the repository is still being indexed, the status will indicate the current progress. Example Response: { "id": "github:main:owner/repo", "status": "COMPLETED", "repository": "owner/repo", "remote": "github", "branch": "main", "private": false, "filesProcessed": 234, "numFiles": 234 }