Overview
Tool Name
Purpose
The gitlab_connector_tools enable direct integration between Genesis Data Agents and GitLab repositories. Manage repositories, files, branches, merge requests, and CI/CD pipelines programmatically—all within your data agent conversations. Perfect for automated documentation, code generation, data pipeline versioning, DevOps automation, and collaborative data projects with enterprise-grade features.Functions Available
git_action
:Core Git operations including repository management, branching, committing, and history tracking.
file
:File operations for reading, writing, searching, and managing repository content.
git_action
(GitLab-specific actions):GitLab platform features including merge requests, remote repository management, and credential storage.
Key Features
Repository Management
Clone, create, list, and delete repositories with full version control integration.
Branch Operations
Create, switch, merge branches and manage parallel development workflows.
Merge Request Automation
Create, review, merge, and close merge requests programmatically for collaborative workflows.
File Management
Read, write, search, copy, move, and delete files with pattern matching and bulk operations.
Commit History
Access commit logs, fetch history, and track changes across repository timelines.
Secure Authentication
Store GitLab credentials securely with support for Personal Access Tokens (PAT).
Input Parameters for Each Function
git_action
Parameters
Name | Definition | Format |
---|---|---|
action | Git operation to perform. Values: commit , get_history , create_branch , switch_branch , get_status , clone_repo , list_repos , pull , push , create_pull_request , etc. | String (required) |
repo_id | Repository identifier. Required for most operations except list_repos and credential storage. | String |
commit_message | Message for commit action. | String |
branch_name | Name of branch for create/switch/pull/push operations or merge request source branch. | String |
url | Git repository URL for cloning or remote operations. | String |
max_count | Maximum number of commits to return in history (for get_history ). | Integer |
file
Parameters
Name | Definition | Format |
---|---|---|
action | File operation. Values: read , write , delete , list , find , search , copy , move , commit , etc. | String (required) |
repo_id | Repository identifier where files are located. | String (required) |
file_path | Relative path to file in repository (no leading /). | String |
content | Content to write to file (for write action). | String |
pattern | Glob pattern for find/search operations (e.g., *.py , **/*.md ). | String |
source_patterns | List of glob patterns for bulk copy/move/delete operations. | Array of Strings |
target_path | Destination directory for copy/move operations. | String |
message | Commit message (for commit action). | String |
Use repo_id consistently across git_action and file operations to work within the same repository context. List available repos with
git_action(action="list_repos")
.Use Cases
- Automated Documentation Generate and commit data dictionaries, API documentation, or pipeline specifications directly to GitLab repositories with automatic CI/CD triggers.
- Code Generation & Versioning Create dbt models, SQL scripts, Terraform configurations, or Python notebooks and version them in GitLab for team collaboration.
- CI/CD Pipeline Integration Update configuration files, trigger pipeline runs, and track deployment artifacts through GitLab’s integrated DevOps platform.
- Collaborative Data Projects Share analysis notebooks, datasets, experiment results, and findings with team members through structured GitLab workflows.
- Enterprise Data Governance Maintain audit trails, approval workflows, and compliance documentation with GitLab’s advanced merge request and access control features.
Workflow/How It Works
-
Step 1: Authenticate with GitLab
Store GitLab credentials securely using Personal Access Token:
-
Step 2: Create or Clone Repository
Start with a new repository or clone an existing one:
-
Step 3: Manage Files
Create, read, and organize files within the repository:
-
Step 4: Commit Changes
Track changes with descriptive commit messages:
-
Step 5: Create Merge Request
Collaborate with team through merge requests:
-
Step 6: Push to GitLab
Sync local changes to remote repository:
Integration Relevance
- project_manager_tools to track data projects and link GitLab repositories to missions.
- data_connector_tools to export analysis results and commit them to version control.
- dbt_action to manage dbt projects in GitLab with full version control and CI/CD.
- file_manager_tools to organize artifacts before committing to repositories.
- slack_tools to notify teams when merge requests are created or commits are pushed.
- scheduler_tools to automate regular commits, syncs, or pipeline triggers.
Configuration Details
- Personal Access Token: Generate from GitLab Settings → Access Tokens. Required scopes:
api
,read_repository
,write_repository
. - Repository Naming: Use lowercase with hyphens (e.g.,
data-pipeline-prod
) for consistency. - Branch Strategy: Use feature branches (
feature/
,bugfix/
,hotfix/
) for changes; protectmain
anddevelop
branches. - Commit Messages: Follow conventional commits format:
feat:
,fix:
,docs:
,ci:
,refactor:
. - File Paths: Always use forward slashes (/) and relative paths without leading slash.
- Large Files: GitLab has 10GB repository size limit; use Git LFS for files over 100MB.
- CI/CD Integration: Merge requests can automatically trigger GitLab CI/CD pipelines defined in
.gitlab-ci.yml
.
Never commit sensitive credentials, API keys, or passwords to GitLab repositories. Use GitLab CI/CD variables or HashiCorp Vault integration for secrets management.
Limitations or Notes
- Repository Size: GitLab recommends keeping repositories under 10GB; large repos may have performance issues.
- API Rate Limits: GitLab has rate limits (varies by tier—Free: 300/min, Premium: 1000/min); batch operations when possible.
- Private Repository Access: Requires appropriate permissions and PAT scopes for private/internal repos.
- Binary Files: Git is optimized for text files; large binary files can slow repository performance.
- Merge Conflicts: Automatic merging may fail with conflicts; manual resolution required.
- Branch Protection: Protected branches prevent direct pushes; use merge requests instead.
- Network Dependency: All operations require internet connectivity to GitLab servers.
- GitLab Version: Some features may require specific GitLab versions (especially self-hosted instances).
Supported Actions
✅ clone_repo - Clone repository from GitLab URL✅ create_repo - Create new local repository
✅ list_repos - Show all available repositories
✅ commit - Commit staged changes
✅ push - Push commits to remote
✅ pull - Pull changes from remote
✅ create_branch - Create new branch
✅ switch_branch - Switch to different branch
✅ get_status - Show repository status
✅ get_history - View commit history
✅ create_pull_request - Create MR on GitLab (auto-detected)
✅ merge_pull_request - Merge MR
✅ close_pull_request - Close MR without merging
✅ get_pull_request_info - Get MR details
✅ store_gitlab_credentials - Save authentication
✅ list_remote_repos - List repos on GitLab
✅ file operations - Full CRUD on repository files
Not Supported
❌ Git submodules or subtrees❌ Git LFS direct management (files can be committed but not managed)
❌ GitLab CI/CD pipeline creation or modification
❌ GitLab Issues, Epics, or Boards management
❌ Repository webhooks configuration
❌ GitLab Pages deployment configuration
❌ Repository transfer or namespace changes
❌ Advanced merge strategies from tool (squash/rebase configurable in GitLab UI)
❌ GitLab Container Registry operations
Output
- clone_repo: Confirmation with repository path and clone details.
- commit: Commit hash, files changed, and commit message confirmation.
- push: Push status, branch name, and remote URL.
- get_history: List of commits with hash, author, date, and message.
- get_status: Current branch, staged/unstaged files, and sync status.
- create_pull_request: MR number, URL (IID), and creation confirmation.
- get_pull_request_info: MR details including status, approvals, pipeline status, and discussion threads.
- file operations: Success confirmation, file paths, and content previews.
- list_repos: Table of repositories with names, paths, and status.
- Errors: Detailed error messages with resolution guidance (e.g., authentication failures, merge conflicts, API limits).
Best Practices
Commit Often
Make small, focused commits with clear messages. Easier to review, revert, and understand history.
Branch Strategy
Use feature branches for development. Keep main/develop stable and use protected branch rules.
Pull Before Push
Always pull latest changes before pushing to avoid conflicts and ensure smooth integration.
Meaningful Messages
Write descriptive commit messages. GitLab supports linking to issues with #123 notation.
Use Merge Requests
Always use MRs for code review and CI/CD validation, even for small changes.
Leverage CI/CD
Define
.gitlab-ci.yml
to automate testing, validation, and deployment on every commit.Example: Complete Data Project Workflow
Advanced Features
Bulk File Operations
Copy multiple files matching patterns:Search Across Files
Find specific content in repository:Fetch Deep History
Get more commit history for analysis:List Remote Repositories
Discover available GitLab projects:GitLab-Specific Features
Merge Request Workflow
Unlike GitHub’s Pull Requests, GitLab uses Merge Requests (MRs) with additional features:- Approval Rules: MRs can require specific approvers before merging
- Pipeline Integration: CI/CD pipelines run automatically on MR creation
- Discussion Threads: Threaded comments that can be resolved
- Draft MRs: Prefix title with “Draft:” or “WIP:” to prevent premature merging
- Squash Commits: Option to squash all commits when merging
Self-Hosted GitLab Support
For self-hosted GitLab instances:Troubleshooting
Authentication Failed
Authentication Failed
- Verify Personal Access Token is valid and not expired
- Check token has required scopes:
api
,read_repository
,write_repository
- For self-hosted: ensure network access to GitLab instance
- Re-store credentials with
store_gitlab_credentials
Push Rejected - Pipeline Failed
Push Rejected - Pipeline Failed
- Check
.gitlab-ci.yml
for syntax errors - Review pipeline logs in GitLab UI
- Ensure CI/CD runners are available
- Fix failing tests before pushing
Push Rejected - Protected Branch
Push Rejected - Protected Branch
- Use merge request workflow instead of direct push
- Pull latest changes first:
git_action(action="pull")
- Check for merge conflicts in
get_status
- Verify you have maintainer/developer role
Merge Request Cannot Be Merged
Merge Request Cannot Be Merged
- Resolve merge conflicts locally first
- Ensure CI/CD pipeline passes
- Check if approval requirements are met
- Verify target branch is not locked
File Not Found
File Not Found
- Verify file_path uses forward slashes (/)
- Check path is relative without leading slash
- Use
file(action="list")
to see available files - Ensure you’re on the correct branch
API Rate Limit Exceeded
API Rate Limit Exceeded
- Wait for rate limit window to reset (usually 1 minute)
- Batch operations to reduce API calls
- Consider upgrading GitLab tier for higher limits
- Check rate limit status in error response
Clone Failed - Repository Not Found
Clone Failed - Repository Not Found
- Verify repository URL is correct
- Check if repository is private and you have access
- Ensure credentials have correct scopes
- For self-hosted: verify network connectivity
Comparison: GitLab vs GitHub
Feature | GitLab | GitHub |
---|---|---|
Code Review | Merge Requests (MRs) | Pull Requests (PRs) |
CI/CD | Built-in (.gitlab-ci.yml ) | GitHub Actions (separate) |
Issue Tracking | Integrated Issues & Boards | GitHub Issues |
Self-Hosted Option | ✅ Yes (GitLab CE/EE) | ❌ Enterprise only |
Approval Workflows | ✅ Advanced approval rules | Limited (required reviewers) |
Container Registry | ✅ Built-in | ✅ GitHub Packages |
Wiki | ✅ Built-in | ✅ Built-in |
API Rate Limits | 300-1000/min (tier-based) | 5000/hour |
The github_connector_tools and gitlab_connector_tools use the same underlying
git_action
and file
functions. The platform auto-detects whether you’re working with GitHub or GitLab based on repository URLs and stored credentials.Security Best Practices
Token Scopes
Use minimal required scopes. Avoid
sudo
and admin
scopes unless absolutely necessary.Token Rotation
Regularly rotate Personal Access Tokens. Set expiration dates and renew proactively.
Protected Branches
Configure branch protection rules in GitLab UI. Require MRs and approvals for main branches.
Secret Management
Use GitLab CI/CD variables (masked/protected) for secrets. Never commit credentials to repos.
Enterprise Features
For GitLab Premium/Ultimate tiers:- Code Owners: Automatic reviewer assignment based on file paths
- Approval Rules: Require specific approvers or groups
- Merge Request Dependencies: Block merging until dependent MRs complete
- Security Scanning: SAST, DAST, dependency scanning in CI/CD
- Compliance Frameworks: Enforce policies and audit requirements
- Advanced Analytics: Code review analytics, productivity metrics
Many enterprise teams choose GitLab for its all-in-one platform approach, especially when self-hosting is required for compliance or data sovereignty requirements.