Gitlab

Learn how to use Gitlab with Composio

Overview

SLUG: GITLAB

Description

A web-based DevOps lifecycle tool that provides a Git repository manager providing wiki, issue-tracking, and CI/CD pipeline features.

Authentication Details

client_id
stringRequired
client_secret
stringRequired
full
stringDefaults to https://gitlab.com/api/v4Required
authorizationUrl
stringDefaults to https://gitlab.comRequired
oauth_redirect_uri
stringDefaults to https://backend.composio.dev/api/v1/auth-apps/add
scopes
stringDefaults to api,read_api,read_user,create_runner,manage_runner,k8s_proxy,read_repository,write_repository,read_registry,write_registry,read_virtual_registry,write_virtual_registry,read_observability,write_observability,ai_features,sudo,read_service_ping,profile,email

Connecting to Gitlab

Create an auth config

Use the dashboard to create an auth config for the Gitlab toolkit. This allows you to connect multiple Gitlab accounts to Composio for agents to use.

1

Select App

Navigate to Gitlab.

2

Configure Auth Config Settings

Select among the supported auth schemes of and configure them here.

3

Create and Get auth config ID

Click “Create Gitlab Auth Config”. After creation, copy the displayed ID starting with ac_. This is your auth config ID. This is not a sensitive ID — you can save it in environment variables or a database. This ID will be used to create connections to the toolkit for a given user.

Connect Your Account

Using OAuth2

1from composio import Composio
2
3# Replace these with your actual values
4gitlab_auth_config_id = "ac_YOUR_GITLAB_CONFIG_ID" # Auth config ID created above
5user_id = "0000-0000-0000" # UUID from database/application
6
7composio = Composio()
8
9
10def authenticate_toolkit(user_id: str, auth_config_id: str):
11 connection_request = composio.connected_accounts.initiate(
12 user_id=user_id,
13 auth_config_id=auth_config_id,
14 )
15
16 print(
17 f"Visit this URL to authenticate Gitlab: {connection_request.redirect_url}"
18 )
19
20 # This will wait for the auth flow to be completed
21 connection_request.wait_for_connection(timeout=15)
22 return connection_request.id
23
24
25connection_id = authenticate_toolkit(user_id, gitlab_auth_config_id)
26
27# You can also verify the connection status using:
28connected_account = composio.connected_accounts.get(connection_id)
29print(f"Connected account: {connected_account}")

Tools

Executing tools

To prototype you can execute some tools to see the responses and working on the Gitlab toolkit’s playground

For code examples, see the Tool calling guide and Provider examples.

Tool List

Tool Name: Archive Project

Description

Tool to archive a project. Use when you need to mark a project read-only after finishing active development. Call after confirming no further changes are required.

Action Parameters

id
Required

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Create GitLab Group

Description

Tool to create a new group in GitLab. Use when you need to establish a new group for projects or collaboration.

Action Parameters

auto_devops_enabled
avatar
default_branch
default_branch_protection_defaults
description
duo_availability
emails_enabled
enabled_git_access_protocol
experiment_features_enabled
extra_shared_runners_minutes_limit
lfs_enabled
membership_lock
mentions_disabled
name
stringRequired
organization_id
parent_id
path
stringRequired
project_creation_level
request_access_enabled
require_two_factor_authentication
share_with_group_lock
shared_runners_minutes_limit
subgroup_creation_level
two_factor_grace_period
visibility
wiki_access_level

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Create Project

Description

Tool to create a new project in GitLab. Implements POST /projects endpoint.

Action Parameters

build_git_strategy
container_registry_enabled
default_branch
description
issues_enabled
merge_requests_enabled
name
stringRequired
namespace_id
path
stringRequired
snippets_enabled
visibility
wiki_enabled

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Create Project Issue

Description

Tool to create a new issue in a GitLab project. Use when you need to report a bug, request a feature, or track a task within a specific project.

Action Parameters

assignee_id
assignee_ids
confidential
created_at
description
discussion_to_resolve
due_date
epic_id
epic_iid
id
stringRequired
iid
issue_type
Defaults to issue
labels
merge_request_to_resolve_discussions_of
milestone_id
title
stringRequired
weight

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Create Repository Branch

Description

Tool to create a new branch in a project. Use when you need to create a new branch from an existing branch or a specific commit in a GitLab project.

Action Parameters

branch_name
stringRequired
project_id
Required
ref
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Delete Project

Description

Tool to delete a GitLab project by its ID. Use when you need to remove a project, either by marking it for later deletion or deleting it immediately.

Action Parameters

full_path
id
Required
permanently_remove

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Download Project Avatar

Description

Tool to download a project’s avatar image. Use when you need the raw avatar bytes after confirming the project exists.

Action Parameters

id
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Erase Job

Description

Tool to erase the content of a specified job within a project. Use when you need to remove job artifacts and logs.

Action Parameters

job_id
integerRequired
project_id
Required

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Commit References

Description

Tool to get all references (branches or tags) a commit is pushed to. Use when you need to find out which branches or tags a specific commit belongs to in a GitLab project.

Action Parameters

project_id
Required
ref_type
Defaults to all
sha
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Commit Sequence

Description

Tool to get the sequence number of a commit in a project by following parent links from the given commit. Use when you need to determine the order of a commit in the project's history.

Action Parameters

first_parent
project_id
Required
sha
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Group Details

Description

Tool to retrieve information about a specific group by its ID. Use when you need to get details of a GitLab group.

Action Parameters

id
Required
with_custom_attributes
with_projects
Defaults to True

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Group Member

Description

Tool to retrieve details for a specific group member. Use when you need to fetch membership information for a user in a group after you know both group ID and user ID.

Action Parameters

id
Required
user_id
integerRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Groups

Description

Get Groups

Action Parameters

all_available
min_access_level
order_by
owned
page
per_page
search
skip_groups[]
sort
statistics
with_custom_attributes
with_projects
with_two_factor

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Job Details

Description

Tool to retrieve details of a single job by its ID within a specified project. Use this when you need to fetch specific information about a particular CI/CD job.

Action Parameters

job_id
integerRequired
project_id
Required

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Merge Request Notes

Description

Tool to fetch comments on a merge request. Use when you need to retrieve all notes for a specific merge request.

Action Parameters

id
Required
merge_request_iid
integerRequired
page
per_page

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Project

Description

Tool to get a single project by ID or URL-encoded path.

Action Parameters

id
Required

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Project Languages

Description

Tool to list programming languages used in a project with percentages. Use when you need the project language breakdown.

Action Parameters

id
Required

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Project Member

Description

Tool to retrieve details for a specific project member. Use after confirming project and user IDs to fetch membership information for a project member.

Action Parameters

id
Required
user_id
integerRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Project Member All

Description

Tool to retrieve details for a specific project member (including inherited and invited members). Use when you need the effective membership info (including invitations and inheritance).

Action Parameters

id
Required
user_id
integerRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Merge Request Commits

Description

Tool to get commits of a merge request. Use when you need to retrieve all commits associated with a specific merge request.

Action Parameters

id
Required
merge_request_iid
integerRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Project Merge Requests

Description

Tool to retrieve a list of merge requests for a specific project. Use when you need to get all merge requests associated with a project, with options to filter by state, labels, milestones, and other attributes.

Action Parameters

approved
approved_by_ids
approver_ids
assignee_id
author_id
author_username
created_after
created_before
deployed_after
deployed_before
environment
id
Required
iids[]
labels
merge_user_id
merge_user_username
milestone
my_reaction_emoji
not_filter
order_by
page
per_page
reviewer_id
reviewer_username
scope
search
sort
source_branch
state
target_branch
updated_after
updated_before
view
wip
with_labels_details
with_merge_status_recheck

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Projects

Description

Tool to list all projects accessible to the authenticated user. Supports filtering.

Action Parameters

archived
id_after
id_before
membership
min_access_level
order_by
owned
page
per_page
search
simple
sort
starred
statistics
visibility
with_custom_attributes
with_issues_enabled
with_merge_requests_enabled
with_programming_language

Action Response

data
arrayRequired
error
successful
booleanRequired

Tool Name: List Merge Request Diffs

Description

Tool to list all diff versions of a merge request. Use when you need to inspect changes across different diff versions after creating or updating a merge request.

Action Parameters

id
Required
merge_request_iid
integerRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Repository Branch

Description

Tool to retrieve information about a specific branch in a project. Use when you need to get details for a single branch.

Action Parameters

branch_name
stringRequired
project_id
Required

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Repository Branches

Description

Retrieves a list of repository branches for a project. Use this when you need to get all branches or search for specific branches within a GitLab project.

Action Parameters

project_id
Required
regex
search

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Single Commit

Description

Tool to get a specific commit identified by the commit hash or name of a branch or tag. Use this when you need to retrieve detailed information about a single commit in a GitLab project repository.

Action Parameters

id
Required
sha
stringRequired
stats
Defaults to True

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Single Pipeline

Description

Tool to retrieve details of a single pipeline by its ID within a specified project. Use when you need to get information about a specific CI/CD pipeline.

Action Parameters

pipeline_id
integerRequired
project_id
Required

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get User

Description

Tool to retrieve information about a specific user by their ID. Use when you need to fetch details for a single GitLab user.

Action Parameters

id
integerRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get User Preferences

Description

Tool to get the current user's preferences. Use when you need to retrieve the user's diff display and CI identity JWT settings after authentication.

Action Parameters

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Users

Description

Tool to retrieve a list of users from GitLab. Use this when you need to find user information, search for specific users, or filter users based on various criteria like activity status or creation date.

Action Parameters

active
admins
auditors
blocked
created_after
created_before
exclude_active
exclude_external
exclude_humans
exclude_internal
extern_uid
external
humans
order_by
page
per_page
provider
search
skip_ldap
sort
two_factor
username
without_project_bots
without_projects

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get User Status

Description

Tool to get a user's status by ID. Use when you need to retrieve a GitLab user's current status message, emoji, and availability after identifying their user ID.

Action Parameters

user_id
integerRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get User Status

Description

Tool to get the current user's status. Use when displaying or verifying the authenticated user's GitLab status after login.

Action Parameters

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get User Support PIN

Description

Tool to get details of the current user's Support PIN. Use when you need to retrieve the active support PIN and its expiration for the authenticated user.

Action Parameters

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Import project members

Description

Tool to import members from one project to another. Use when migrating members between projects.

Action Parameters

id
stringRequired
project_id
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: List All Group Members

Description

Tool to list all members of a group including direct, inherited, and invited members. Use when you need a comprehensive membership list beyond direct members.

Action Parameters

id
Required
page
per_page

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: List All Project Members

Description

Tool to list all members of a project (direct, inherited, invited). Use when you need the effective membership list including inherited and invited members.

Action Parameters

id
Required
page
per_page
query
show_seat_info
state
user_ids

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: List Billable Group Members

Description

Tool to list billable members of a top-level group (including its subgroups and projects). Use when generating billing reports; requires Owner role on the group.

Action Parameters

id
Required
page
per_page
search
sort

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: List Group Members

Description

Tool to list direct members of a group. Use when you need to retrieve or filter a group's direct membership.

Action Parameters

active
id
Required
include_inherited
page
per_page
query
relations
skip_users
sort
two_factor

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: List Pending Group Members

Description

Tool to list pending members of a group and its subgroups and projects. Use when you need to review users awaiting approval or invited without an account. Call after confirming the top-level group ID.

Action Parameters

id
Required
page
per_page

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: List Pipeline Jobs

Description

Tool to retrieve a list of jobs for a specified pipeline within a project. Use this when you need to inspect the status or details of jobs associated with a particular CI/CD pipeline.

Action Parameters

id
Required
include_retried
pipeline_id
integerRequired
scope

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: List Project Groups

Description

Tool to list ancestor groups of a project. Use when you need to retrieve all groups a project belongs to or is shared with.

Action Parameters

id
Required
page
per_page
search
shared_min_access_level
shared_visible_only
skip_groups
with_shared

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: List Project Invited Groups

Description

Tool to list groups invited to a project. Use when auditing which groups have access to a project.

Action Parameters

id
Required
page
per_page

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: List Project Pipelines

Description

Tool to retrieve a list of pipelines for a specified project. Use when you need to get information about CI/CD pipelines, such as their status, source, or creation/update times.

Action Parameters

created_after
created_before
id
Required
name
order_by
Defaults to id
page
per_page
ref
scope
sha
sort
Defaults to desc
source
status
updated_after
updated_before
username
yaml_errors

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: List Project Shareable Groups

Description

Tool to list groups that can be shared with a project. Use before sharing a project to fetch eligible groups.

Action Parameters

id
Required
page
per_page
search
skip_groups

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: List Project Repository Tags

Description

Tool to retrieve a list of repository tags for a specified project. Use when you need to get all tags associated with a project in GitLab.

Action Parameters

id
Required
order_by
page
per_page
search
sort

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: List Project Transfer Locations

Description

Tool to list namespaces available for project transfer. Use when you need to determine which groups a project can be transferred into.

Action Parameters

id
Required
search

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: List project users

Description

Tool to list users of a project. Use after you have a project ID and want to retrieve its users.

Action Parameters

id
stringRequired
search
skip_users

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: List Repository Commits

Description

Tool to get a list of repository commits in a project. Use when you need to retrieve commit history for a specific project, branch, or time range.

Action Parameters

all
author
first_parent
order
path
project_id
Required
ref_name
since
trailers
until
with_stats

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: List User Projects

Description

Tool to list projects owned by a specific user. Use after obtaining target user identity to fetch owned projects.

Action Parameters

archived
id
Required
id_after
id_before
membership
min_access_level
order_by
owned
page
per_page
search
simple
sort
starred
statistics
updated_after
updated_before
visibility
with_custom_attributes
with_issues_enabled
with_merge_requests_enabled
with_programming_language

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Create Support PIN

Description

Tool to create a support PIN for your authenticated user. Use when GitLab Support requests a PIN to verify your identity.

Action Parameters

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Update User Preferences

Description

Tool to update the current user's preferences. Use when adjusting default diff viewing and CI identity settings.

Action Parameters

pass_user_identities_to_ci_jwt
booleanRequired
show_whitespace_in_diffs
booleanRequired
view_diffs_file_by_file
booleanRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Set User Status

Description

Tool to set the current user's status. Use when you need to update availability or convey current mood on GitLab.

Action Parameters

clear_status_after
emoji
message

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Share Project With Group

Description

Tool to share a project with a group. Use when you need to grant a group specific access level to a project.

Action Parameters

expires_at
group_access
integerRequired
group_id
integerRequired
id
Required

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Start Housekeeping Task

Description

Tool to start the housekeeping task for a project. Use when you need to trigger manual maintenance or pruning on a repository.

Action Parameters

id
Required
task

Action Response

data
objectRequired
error
successful
booleanRequired