get_repository_info
Retrieve indexed repository metadata and status from GitHub or GitLab to verify indexing completion and access repository details.
Instructions
Get information about an indexed repository including status and metadata
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| remote | Yes | Repository host | |
| repository | Yes | Repository in owner/repo format | |
| branch | Yes | Branch that was indexed |
Implementation Reference
- src/server.ts:549-579 (handler)Primary handler function that executes the get_repository_info tool logic, checks client initialization, extracts parameters, calls GreptileClient.getRepositoryInfo, and formats the response.private async handleGetRepositoryInfo( args: unknown ): Promise<{ content: Array<{ type: string; text: string }> }> { if (!this.greptileClient) { return { content: [ { type: 'text', text: createErrorResponse( 'Cannot get repository info: Missing environment variables. Use greptile_env_check for setup guidance.', 'Configuration Error', undefined ), }, ], }; } const { remote, repository, branch } = args as any; const result = await this.greptileClient.getRepositoryInfo(remote, repository, branch); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
- src/server.ts:196-217 (registration)Registration of the get_repository_info tool in the ListToolsRequestSchema handler, including name, description, and input schema definition.name: 'get_repository_info', description: 'Get information about an indexed repository including status and metadata', inputSchema: { type: 'object', properties: { remote: { type: 'string', enum: ['github', 'gitlab'], description: 'Repository host', }, repository: { type: 'string', description: 'Repository in owner/repo format', }, branch: { type: 'string', description: 'Branch that was indexed', }, }, required: ['remote', 'repository', 'branch'], }, },
- src/types/index.ts:97-101 (schema)TypeScript interface defining the expected input structure for the get_repository_info tool.export interface GetRepositoryInfoInput { remote: string; repository: string; branch: string; }
- src/clients/greptile.ts:192-203 (helper)GreptileClient helper method that constructs the API endpoint and makes the HTTP GET request to fetch repository information from the Greptile API.async getRepositoryInfo( remote: string, repository: string, branch: string, timeout?: number ): Promise<Record<string, unknown>> { const repositoryId = `${remote}:${branch}:${repository}`; const encodedId = encodeURIComponent(repositoryId); const url = `${this.baseUrl}/repositories/${encodedId}`; return this.makeRequest('GET', url, undefined, timeout); }
- src/server.ts:237-238 (registration)Dispatcher case in the CallToolRequestSchema handler that routes to the get_repository_info handler function.case 'get_repository_info': return await this.handleGetRepositoryInfo(request.params.arguments);