Overview
Tool Name
git_action and file tools of the
git_and_file_tools group, over a saved GitLab Connection. There is no separate
GitLab connector tool.
Purpose
Thegit_action and file 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).
Use
git_action and related GitLab connector workflows for common repository,
file, branch, merge-request, and review tasks. To read long-tail GitLab REST
endpoints under /api/v4/... that are not covered here, use
connection_api_action from Web Access Tools
so Genesis can reuse the saved GitLab Connection and handle missing or
expired authorization correctly. With no Action Review rule that could cover
git_action’s changes, it also sends changes. Where such a rule exists, a change
to a project goes to that rule as git_action(action="gitlab_api_request"),
which runs it, holds it for a person, or refuses it; see
Other Project Changes.Input Parameters for Each Function
git_action
Parameters
file
Parameters
Transferring existing files. When the source already lives in a repository,
use
file(action="copy") or file(action="move") for byte-exact server-side
transfer — never read a file and write the same bytes back. For inline or
generated binary content that is not already on disk, write base64 with
is_base64=true. Without is_base64=true, the base64 string is written as
literal ASCII text and the file is corrupt. For write_multiple, set
is_base64 inside each files[] item rather than at the top level. See
Git Action Tools for examples.With
git_action(action="list_repos", details=True), Genesis always returns
has_remote as true or false so agents can filter cleanly. When a remote
exists, remote_url is credentials-redacted and clone_source is set when
Genesis can infer github, gitlab, bitbucket, or azure_devops. Use
include_paths=True to add path to each detail row.file(action="read") supports partial and targeted reads with start_line, end_line, max_lines, start_byte, max_bytes, end_byte, tail_bytes, max_chars, search_pattern, context_lines_before, context_lines_after, max_matches, return_line_numbers, encoding, force_text, and return_base64. file(action="read_multiple") forwards the same controls per file entry.Extremely large single-file reads follow the same guardrail as
git_action: when git_action(action="read_file"), file(action="read"), or file(action="inspect_structured_data") exceeds the file-read inline budget (default 65,536 bytes / 64 KB, configurable with GENESIS_TOOL_OUTPUT_FILE_READ_BUDGET), Genesis returns tool_output_capped, preview, truncation_info, full_output_ref, and agent_guidance. When full_output_ref is not null, the full text is saved under truncated_tool_outputs/<thread_id>/... in the apps BotGit repo and can be paged back with file(action="read", file_path=full_output_ref, repo_id="apps", start_byte=0, max_bytes=N), continuing from each response’s continuation.next_start_byte. The byte range is the shape that returns the saved copy exactly as written; the whole-file and line-window paths read in text mode and rewrite line endings.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:
Add
branch_name="release/2026.05" to clone and check out a non-default
branch in one call. Unless you override them, shallow and
single_branch both default to true; set depth=0 for full history.-
Step 3: Manage Files
Create, read, and organize files within the repository:
-
Step 4: Commit Changes
Track changes with descriptive commit messages:
Every agent commit names the person who asked for the change in a
Co-authored-by: line (or Requested-by:, depending on the connection’s
git_requester_credit setting); see
Crediting the person who asked.
git_action(action="commit") also accepts optional co_authors, for
example ["Jane Doe <[email protected]>"], to credit other collaborators.
Both are separate from the primary author chosen through the saved GitLab
connection.-
Step 5: Create Merge Request
Collaborate with team through merge requests:
-
Step 6: Push to GitLab
Sync local changes to remote repository:
Managed GitLab API Commits
Usegit_action(action="commit_files_via_api") to land one or more prepared
file changes on a managed GitLab branch through the GitLab Commits API. This
is useful when a GitLab installation blocks raw git push on WIP branches or
when you want an optimistic-concurrency check before committing.
Use
source_path for non-trivial content so Genesis reads the file from disk
when preparing the commit and again immediately before submission. Genesis
binds the file’s exact content and refuses the whole commit if the content
changed. source_path must stay inside the prepared managed repo or
worktree for that commit. Genesis rejects symlinks and paths that escape
that root. Inline content is intended only for very small files and is
also bound to the approval.The approval also freezes the commit base. For an existing
branch_name,
Genesis binds its current tip; for a new branch, it binds the commit that
start_branch currently points to. If the target branch moves, appears,
disappears, or cannot be read before approval is submitted, nothing is sent
and the action must be proposed again. expected_branch_head_sha still
provides the optional caller-side check for an existing branch; when it does
not match, the response includes error_code="STALE_REMOTE_HEAD",
expected_sha, and actual_sha.After approval,
action_review.status="not_applied" means GitLab refused the
commit and detail explains why; nothing was written. If the status is
reconciliation_required, the remote result is uncertain and you must not
retry, because the commit may already exist. The Git transport cannot
currently prove that a read-back uses the same credential as the approved
write, so Genesis does not automatically confirm an uncertain commit by
reading the target branch; the result remains inconclusive.Merge Request Comments
Usegit_action(action="add_merge_request_note") to post a comment on a merge
request of the repository’s own GitLab project, either on the whole merge
request or on one line of its diff. It
runs under Action Review like the other GitLab changes: depending on your
deployment’s rules it is posted at once or waits for a person’s approval, who
sees the exact text that will be posted.
A comment on a line is tied to the diff the merge request had when it was
proposed. If new commits are pushed before it is posted, it is not posted and
must be proposed again, so an approval never lands on lines nobody reviewed.
A line starting with
/ is refused, because GitLab would run it as a quick
action (such as /close or /approve) and change the merge request. Where an
Action Review rule could cover git_action’s changes, a raw
POST /merge_requests/.../notes call through connection_api_action goes to
that rule, and a rule written for this action governs it too.Other Project Changes
Usegit_action(action="gitlab_api_request") for a change to a GitLab project
that no other git_action action makes: approving or unapproving a merge
request, creating, updating, closing and commenting on issues, labels, tags and
releases, running, retrying or cancelling a pipeline, CI/CD variables, protected
branches, webhooks, members, and project settings. It sends one request to the
GitLab REST API of a saved GitLab connection, with exactly the method, path,
headers and body you give it, and runs under Action Review like the other GitLab
changes. With no rule covering it, it is sent at once. With one, the rule
allows it, holds it for a person, or refuses it. The person reviewing sees the
exact method, path, headers (in order) and body (a JSON body as JSON, any other
as its type, size and sha256, with its text when it is short), and an approved
request sends exactly them, once.
Rules see the project by its GitLab path (such as
acme/widgets), even when
the request names it by its numeric id, the action as the tag
action:gitlab_api_request, and the kind of resource it changes as the tag
gitlab_api:<resource> (for example gitlab_api:variables). Every request is
a destructive, irreversible write, because Genesis cannot tell what an
arbitrary request removes or overwrites, so a rule on destructive writes
covers it, and a standing grant never does. A request that makes the change of
a dedicated action (opening, updating, closing or merging a merge request, a
merge request comment, deleting a branch, committing files, deleting the
project) also carries that action’s tag, such as action:merge_pull_request,
and the merge request or branch it changes (acme/widgets#7), so a rule
written for the dedicated action governs it the same way. A comment with a
line GitLab would run as a quick action counts as the update, close and merge
it could make. After approval it is sent as the person who asked: on a
connection where each person signs in, it is never sent with the approver’s
sign-in, and it is refused if the requester’s has gone. A raw write through
connection_api_action that a rule could cover goes to the rule as this
action. So does one through the web tool (api_data), made through the
saved connection that serves the URL’s host and base path; a web call that
brings its own credentials (auth, a token header, credentials in the URL, or
secret references in the body) is refused and names this action instead, so
the change is never made by someone other than the caller intended. On an
install with no saved GitLab connection whose GitLab credential comes only
from its environment (GITLAB_TOKEN or GITLAB_PRIVATE_TOKEN, for
GITLAB_BASE_URL), a covered raw write through either door is made with that
deployment credential instead, the same credential such writes used before
Action Review. The same applies to commit_files_via_api when a rule could
govern that specific action: the commit goes through Action Review using the
deployment credential, and its review card identifies it as the deployment’s
credential. A rule on a different git_action action does not make the commit
eligible for this path. When no rule could govern it, the API commit keeps its
direct path. Its card says it runs with this deployment’s GitLab credential,
not a person’s, and names the GitLab account that credential signs in as; the
rule allows, holds or denies it as any other. The account is read when the
write is proposed (GET /api/v4/user) and again before an approved write is
sent: a token rotated to another token of the same account keeps working, but
one that signs in as a different account, or an account read that fails, stops
the write and nothing is sent. An approval made before Genesis recorded the
account is not applied; approve it again. No
person’s credential is ever used for it: if a saved GitLab connection is added,
or the environment credential is removed, before an approved write is sent, it
is not sent. The person who asked must still be allowed to use git_action;
that is checked again before an approved write is sent. A GITLAB_BASE_URL
over plain http is refused unless it is localhost, as is one whose host is
ambiguous (a backslash or user information in it); a redirect from GitLab
is never followed; and a localhost GitLab over http is reached directly,
never through an HTTP_PROXY or ALL_PROXY. So the token never crosses the
network unencrypted; and a saved GitLab connection that cannot be
read still counts as one, so it never switches the environment credential on.
To call this action
directly on such an install, pass connection="gitlab.<deployment>". With no
rule, an install like this behaves as before. A GitLab GraphQL mutation is
not sent by this action: it goes to the rule as gitlab_graphql_request (below).
A write to a group, a user or the instance is judged on that scope instead of a
project: group:<path> (a group named by id is resolved to its own path and
id), user:<id> (a user is named by its numeric id), user:current together
with user:<id> of the account the connection signs in as, and
gitlab:<host> for the instance on every install, with the tags
gitlab_scope:<scope> and gitlab_api:<resource>. The scope is read from the
path as it is sent, so %70rojects/42 is project 42 and users/005 is user 5.
Moving a project into a group (POST /api/v4/groups/<group>/projects/<project>)
or ending its share with a group is also judged on that project. A write that
names a second group, namespace or project is also judged on it: sharing a group
or project with a group (group_id), moving a group under one (group_id or
parent_id), creating a subgroup (parent_id), transferring or forking a
project into a namespace (namespace, namespace_id, namespace_path), and
marking a project a fork of another. A destination GitLab cannot resolve is
refused. Creating a project
(POST /api/v4/projects, or /api/v4/projects/user/<id>) is also judged as
create_remote_repo on the repository it creates, in the namespace
namespace_id names when given; when the request gives no path, GitLab
chooses it, so every rule on a repository in that namespace applies. A group,
namespace or project GitLab cannot resolve is refused. With no rule that could
cover a git_action write, gitlab_api_request still refuses a path outside
one project, as before.
A request that names its own GitLab credential or identity (private_token,
access_token, job_token, token, feed_token, rss_token,
bearer_token or sudo, in the query or the body) is refused, because GitLab
would act on it instead of the connection. A webhook’s token, its validation
secret, is allowed when creating or updating a webhook, where it signs nobody
in. A path with an encoded / or \ where GitLab could route it differently
is refused; a branch, file, tag or release name may still hold one. A
request that deletes every merged branch is judged against every rule scoped
to a branch of the project, since the branches it removes cannot be listed in
advance. A quick action in a note or a merge request description (/merge,
/close, /reopen, /title) is judged as the change it makes; one such as
/approve or /label is not judged as a merge or a close. A call’s own
headers and body are kept: a web-tool call goes with exactly the bytes,
Content-Type and headers the web tool would send with no rule (a form, text,
XML or JSON), and a connection_api_action call as that tool would send it (no
body with a DELETE). A form body is read as GitLab reads it. A body the
rules cannot read (XML, plain text, a multipart or binary body) is judged
against every rule that could cover what it might change, on any project,
branch or namespace and as every dedicated action its route could make, and
the card says so. A web-tool call asking to save the answer (save_to_file)
is refused, which this action cannot do. Changing the protection of a branch pattern such as release-* or * is
judged against every rule scoped to a branch of the project, and a request
naming one branch (such as removing the protection of main) carries that
branch’s branch: tag. A commit with force set is also judged as a force
push (action:push_force) on its branch. A merge request opened in another
project with target_project_id is also judged in that project, with the
commands its description runs, and the project is resolved as the person who asked; one GitLab cannot resolve is refused.
dry_run=True returns the exact request the action would send, and sends and
proposes nothing. Parameters count from the query
string and the body alike, and the project’s GitLab id is bound to the
approval, so a project replaced at the same path is not changed under an
approval given for the one before it. Under a covering rule a DELETE
through connection_api_action needs no separate confirmed=True: the rule
decides it.
Prefer the dedicated actions where one exists (pushes, merge requests,
branches, committed files, merge request comments): they check more before
they write. If a request’s outcome is uncertain, check the project in GitLab
before sending it again.GraphQL Changes
Usegit_action(action="gitlab_graphql_request") for a GitLab GraphQL
mutation. Pass the request as api_body: {"query": ..., "variables": ..., "operationName": ...}, or a list of them for a batch. Form text (query=...,
with its Content-Type in api_headers) is sent as its own bytes and judged as
GitLab runs those bytes, as the other doors send it. It runs under Action
Review like the other GitLab changes. With no rule covering it, it is sent at
once. With one, the rule allows it, holds it for a person, or refuses it. The
card shows “GraphQL mutation:” and the mutations it runs, then each request
exactly as it is sent, and an approved request sends exactly that, once, as the
person who asked. A GraphQL write through the web tool (api_data to
/api/graphql) or connection_api_action (path="/api/graphql") that a rule
could cover goes to the rule as this action, whether it is sent as JSON,
form-encoded, as a batch, or hidden behind a read in GitLab’s _json
multiplex.
Every top-level mutation field is judged on its own, on the project, merge
request and branch it names. A field that makes the change of a dedicated
action (accepting, updating, closing or drafting a merge request, opening
one, creating or editing a note on one with the quick actions it runs, a
commit, deleting a branch) is also judged as that action, so a rule written
for
merge_pull_request or commit_files_via_api governs its GraphQL
equivalent. Projects are resolved to GitLab’s own path and id; a merge
request or note named by its global id is resolved to its merge request
first. When a field does not name what it changes, it is judged by every rule
on its project, or by every project rule when the project is not known. A
mutation is reported as made only when GitLab’s answer shows it succeeded:
each mutation answered, selecting its errors list and reporting none.
Otherwise the outcome is uncertain and it is not sent again; check GitLab
first. A document that cannot be read, or a project GitLab does not resolve,
is refused before anything is sent.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. Includeread_apiwhen you needlist_remote_repos(and Context Graph Select repos) to list group/organization projects, not only personal ones. - Git Commit Author (
git_author_mode): Optional select field on the saved GitLab connection. Default:genesis_bot. Supported values:genesis_bot,authenticated_git_user,custom. - Git Author Name (
git_author_name) and Git Author Email (git_author_email): Optional string fields on the saved GitLab connection. Genesis shows them only whengit_author_mode="custom", and both are required together in that mode. - Credit the person who asked for the change (
git_requester_credit): Optional select field on the saved GitLab connection. Default:co_author. Supported values:co_author(addsCo-authored-by: Name <email>with the person’s registered email),requested_by(addsRequested-by: Name),off. An email in a commit is permanent and visible to everyone who can read the repository’s history. - Repository Naming: Use lowercase with hyphens (e.g.,
data-pipeline-prod) for consistency. - Branch Strategy: Use feature branches (
feature/,bugfix/,hotfix/) for changes; protectmainanddevelopbranches. - 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.
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
✅ gitlab_api_request - Any other project change through the GitLab REST API (issues, labels, tags, releases, pipelines, CI/CD variables, protected branches, webhooks, members, settings), under Action Review
✅ store_gitlab_credentials - Save authentication
✅ list_remote_repos - List repos on GitLab
✅ file operations - Full CRUD on repository files, including batch reads with
file(action="read_multiple")
Not Supported
❌ Git submodules or subtrees❌ Git LFS direct management (files can be committed but not managed)
❌ Triggering a pipeline with a pipeline trigger token (run, retry and cancel pipelines, and change their metadata or schedules, with
gitlab_api_request; change the pipeline definition by committing .gitlab-ci.yml)❌ GitLab Epics or Boards management, and other group-level changes
❌ 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, content previews, batch read results with per-file success or error details plus
contentandsizefor successful reads. Batch reads can also surface per-filetruncated,truncation_info,continuation,encoding,file_type,total_size,returned_size,returned_lines,total_lines,start_line,end_line,start_byte, andend_byte, plus top-levelwarnings,files_truncated,files_skipped,skipped_preview, andcontinuation_hintwhen the response is cut short. - Large path and archive previews:
file(action="list")andfile(action="find")can returnfiles_preview,files_truncated,files_omitted_count,total_files,files_continuation_hint,note, andnarrowing_hintwhen many paths match.file(action="unzip")can similarly previewextracted_filesanddownload_linkswith fields such asextracted_files_preview,extracted_files_truncated,extracted_files_omitted_count,total_extracted_files,extracted_files_continuation_hint,download_links_preview,download_links_truncated,download_links_omitted_count,total_download_links, anddownload_links_continuation_hint. - Zero-result repo search warning:
git_action(action="search"),git_action(action="grep"),file(action="search"), andfile(action="fast_search")can include_branch_warningwhen a repo on a non-default branch returns0matches. The object includescurrent_branch,default_branch, andmessage, which directs you to switch to the default branch, rungit_action(action="pull"), and retry the search. - list_repos: Repository ids by default. With
details=true, each detail row includesmode,has_git_dir,has_remote,scope,owner_user_id,owner_bot_id, andundeletable, plus credentials-redactedremote_urlwhen present,clone_sourcewhen Genesis can infer the remote platform, andpathwheninclude_paths=true. - list_remote_repos:
personal_repos(flat list of user-namespace projects) andorganization_repos(list of{org, org_url, repos}buckets per GitLab namespace, matching the GitHublist_remote_reposshape so UIs canflatMapgroup repos the same way for both providers). Each repo entry includesname,full_name,url,ssh_url,private,description,default_branch,created_at, andupdated_at. Optionalwarnings(array of strings) when group listing partially fails—for example membership scope returns HTTP 403 because the PAT lacksread_api, or a listing reaches the 10,000-project cap. Genesis caps each owned and membership listing independently at 10,000 projects;truncated: trueand a warning report when a listing reaches the cap. - 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:preserve_structure defaults to true for file(action="copy") and file(action="move"). Glob patterns preserve the path below the matched parent scope. Exact file paths use their parent directory as the matched scope, so source_patterns=["reports/monthly/summary.md"] writes archive/summary.md instead of recreating archive/reports/monthly/summary.md.file(action="read_multiple") accepts a recommended maximum of 20 files per call and a hard limit of 100. Total returned content is capped at 200 KB; when that limit is reached, remaining files are reported in skipped, skipped_preview, and files_skipped, and the top-level response adds continuation_hint. Large files are automatically truncated to about 20 KB. Successful reads include per-file content and size; truncated entries are marked with truncated: true and can also include truncation_info, continuation, encoding, file_type, total_size, returned_size, returned_lines, total_lines, start_line, end_line, start_byte, and end_byte. If any entry is truncated, the batch response adds a warning explaining how to continue from the correct byte or line offset, and the top-level response includes files_truncated with the count of truncated files. Use file(action="read") for binary or Excel files.Very large
list, find, and unzip responses are previewed instead of returned in full. files and extracted_files previews are trimmed to the first 50 paths, and download_links previews are trimmed to the first 20 links. Use fields such as files_preview, files_truncated, files_omitted_count, total_files, files_continuation_hint, note, and narrowing_hint to narrow list or find queries, or extracted_files_preview and download_links_preview to inspect the extracted directory.Search Across Files
Find specific content in repository:When
git_action(action="search"), git_action(action="grep"), file(action="search"), or file(action="fast_search") returns zero matches for a repo on a non-default branch, the response can include _branch_warning with current_branch, default_branch, and message. Follow _branch_warning.message to switch to the default branch, run git_action(action="pull"), and retry the search.Fetch Deep History
Get more commit history for analysis:List Remote Repositories
Discover available GitLab projects across your personal namespace and, by default, groups you belong to:include_orgs is optional and defaults to true. The response mirrors
GitHub list_remote_repos: personal_repos is a flat list;
organization_repos is [{org, org_url, repos}, ...] keyed by GitLab
namespace full_path. Check warnings when group projects are missing—a
common case is a PAT without the read_api scope for membership listing.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
list_remote_repos Shows Only Personal Projects
list_remote_repos Shows Only Personal Projects
- Group/organization projects come from GitLab
membership=truelisting; the PAT needsread_api - Inspect the
warningsarray on the response for HTTP 403/401 hints - Recreate or widen the saved GitLab connection PAT, then retry Select repos or
git_action(action="list_remote_repos")
Push Rejected - Pipeline Failed
Push Rejected - Pipeline Failed
- Check
.gitlab-ci.ymlfor 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
API Commit Fails - STALE_REMOTE_HEAD
API Commit Fails - STALE_REMOTE_HEAD
- Another commit reached the target branch after your API commit was prepared
- The response includes
expected_shaandactual_shaso you can see the mismatch - Refresh the dev session or re-read the managed repo state, then rebuild the change against the latest remote branch head and retry
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
GitHub and GitLab repositories use the same
git_action and file tools. 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

