remote_list
List all remote repositories in a specified Git repository path using the Git MCP Server for enhanced Git operations.
Instructions
List remotes
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Path to repository. MUST be an absolute path (e.g., /Users/username/projects/my-repo) |
Implementation Reference
- src/git-operations.ts:596-623 (handler)The primary handler for the 'remote_list' tool. It validates the repository path, executes 'git remote -v', formats the output, and handles caching.static async remoteList(options: BasePathOptions, context: GitToolContext): Promise<GitToolResult> { const path = this.getPath(options); return await this.executeOperation( context.operation, path, async () => { const { path: repoPath } = PathValidator.validateGitRepo(path); const result = await CommandExecutor.executeGitCommand( 'remote -v', context.operation, repoPath ); const output = result.stdout.trim(); return { content: [{ type: 'text', text: output || 'No remotes configured' }] }; }, { useCache: true, stateType: RepoStateType.REMOTE, command: 'remote -v' } ); }
- src/tool-handler.ts:370-382 (schema)Defines the MCP input schema for the 'remote_list' tool, specifying the optional 'path' parameter.name: 'remote_list', description: 'List remotes', inputSchema: { type: 'object', properties: { path: { type: 'string', description: `Path to repository. ${PATH_DESCRIPTION}`, }, }, required: [], }, },
- src/tool-handler.ts:638-641 (registration)Dispatches execution of the 'remote_list' tool to the GitOperations.remoteList handler after validating arguments with isPathOnly.case 'remote_list': { const validArgs = this.validateArguments(operation, args, isPathOnly); return await GitOperations.remoteList(validArgs, context); }