tag_list
List all tags in a Git repository by providing its absolute path. Enables efficient tag management via the Git MCP Server for streamlined version control workflows.
Instructions
List tags
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:501-528 (handler)The handler function `GitOperations.tagList` that validates the repository path, executes `git tag -l` command with caching, and returns the list of tags as text content.static async tagList(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( 'tag -l', context.operation, repoPath ); const output = result.stdout.trim(); return { content: [{ type: 'text', text: output || 'No tags found' }] }; }, { useCache: true, stateType: RepoStateType.TAG, command: 'tag -l' } ); }
- src/tool-handler.ts:623-626 (registration)The switch case in the tool executor that handles the 'tag_list' tool call by validating arguments and delegating to `GitOperations.tagList`.case 'tag_list': { const validArgs = this.validateArguments(operation, args, isPathOnly); return await GitOperations.tagList(validArgs, context); }
- src/tool-handler.ts:301-313 (schema)The tool registration definition including the name 'tag_list', description, and input schema specifying an optional repository path.name: 'tag_list', description: 'List tags', inputSchema: { type: 'object', properties: { path: { type: 'string', description: `Path to repository. ${PATH_DESCRIPTION}`, }, }, required: [], }, },