status
Check the status of a Git repository with an absolute path to identify changes, untracked files, and branch information for streamlined version control.
Instructions
Get repository status
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:151-177 (handler)The primary handler function that executes the 'git status' command, validates the repository path, uses caching, and returns the formatted status output as a GitToolResult.static async status(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( 'status', context.operation, repoPath ); return { content: [{ type: 'text', text: CommandExecutor.formatOutput(result) }] }; }, { useCache: true, stateType: RepoStateType.STATUS, command: 'status' } ); }
- src/tool-handler.ts:102-115 (registration)Registration of the 'status' tool in the MCP tools list, including name, description, and JSON input schema definition.{ name: 'status', description: 'Get repository status', inputSchema: { type: 'object', properties: { path: { type: 'string', description: `Path to repository. ${PATH_DESCRIPTION}`, }, }, required: [], }, },
- src/tool-handler.ts:578-581 (registration)Switch case in the tool executor that handles 'status' tool calls by validating arguments and delegating to GitOperations.status.case 'status': { const validArgs = this.validateArguments(operation, args, isPathOnly); return await GitOperations.status(validArgs, context); }
- src/tool-handler.ts:105-114 (schema)JSON schema defining the input parameters for the 'status' tool (optional path).inputSchema: { type: 'object', properties: { path: { type: 'string', description: `Path to repository. ${PATH_DESCRIPTION}`, }, }, required: [], },