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
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
bearer_token
string

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

Python
1from composio import Composio
2from openai import OpenAI
3import json
4
5openai = OpenAI()
6composio = Composio()
7
8# User ID must be a valid UUID format
9user_id = "0000-0000-0000" # Replace with actual user UUID from your database
10
11tools = composio.tools.get(user_id=user_id, toolkits=["GITLAB"])
12
13print("[!] Tools:")
14print(json.dumps(tools))
15
16def invoke_llm(task = "What can you do?"):
17 completion = openai.chat.completions.create(
18 model="gpt-4o",
19 messages=[
20 {
21 "role": "user",
22 "content": task, # Your task here!
23 },
24 ],
25 tools=tools,
26 )
27
28 # Handle Result from tool call
29 result = composio.provider.handle_tool_calls(user_id=user_id, response=completion)
30 print(f"[!] Completion: {completion}")
31 print(f"[!] Tool call result: {result}")
32
33invoke_llm()

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
integerRequired

Action Response

data
objectRequired
error
string
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
boolean
avatar
string
default_branch
string
default_branch_protection_defaults
object
description
string
duo_availability
string
emails_enabled
boolean
enabled_git_access_protocol
string
experiment_features_enabled
boolean
extra_shared_runners_minutes_limit
integer
lfs_enabled
boolean
membership_lock
boolean
mentions_disabled
boolean
name
stringRequired
organization_id
integer
parent_id
integer
path
stringRequired
project_creation_level
string
request_access_enabled
boolean
require_two_factor_authentication
boolean
share_with_group_lock
boolean
shared_runners_minutes_limit
integer
subgroup_creation_level
string
two_factor_grace_period
integer
visibility
string
wiki_access_level
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create Project

Description

Tool to create a new project in gitlab. implements post /projects endpoint.

Action Parameters

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

Action Response

data
objectRequired
error
string
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
integer
assignee_ids
array
confidential
boolean
created_at
string
description
string
discussion_to_resolve
string
due_date
string
epic_id
integer
epic_iid
integer
id
stringRequired
iid
integer
issue_type
stringDefaults to issue
labels
string
merge_request_to_resolve_discussions_of
integer
milestone_id
integer
title
stringRequired
weight
integer

Action Response

data
objectRequired
error
string
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
integerRequired
ref
stringRequired

Action Response

data
objectRequired
error
string
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
integerRequired
merge_request_iid
integerRequired
page
integer
per_page
integer

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Project

Description

Tool to get a single project by id or url-encoded path.

Action Parameters

id
integerRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Projects

Description

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

Action Parameters

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

Action Response

data
arrayRequired
error
string
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
integerRequired

Action Response

data
objectRequired
error
string
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
boolean
admins
boolean
auditors
boolean
blocked
boolean
created_after
string
created_before
string
exclude_active
boolean
exclude_external
boolean
exclude_humans
boolean
exclude_internal
boolean
extern_uid
string
external
boolean
humans
boolean
order_by
string
page
integer
per_page
integer
provider
string
search
string
skip_ldap
boolean
sort
string
two_factor
string
username
string
without_project_bots
boolean
without_projects
boolean

Action Response

data
objectRequired
error
string
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
string
skip_users
array

Action Response

data
objectRequired
error
string
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
string
id
integerRequired
permanently_remove
boolean

Action Response

data
objectRequired
error
string
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
string
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
integerRequired

Action Response

data
objectRequired
error
string
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
integerRequired
ref_type
stringDefaults to all
sha
stringRequired

Action Response

data
objectRequired
error
string
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
boolean
project_id
integerRequired
sha
stringRequired

Action Response

data
objectRequired
error
string
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
integerRequired
with_custom_attributes
boolean
with_projects
booleanDefaults to True

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Groups

Description

Get groups

Action Parameters

all_available
boolean
min_access_level
integer
order_by
string
owned
boolean
page
integer
per_page
integer
search
string
skip_groups[]
array
sort
string
statistics
boolean
with_custom_attributes
boolean
with_projects
boolean
with_two_factor
boolean

Action Response

data
objectRequired
error
string
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
integerRequired
user_id
integerRequired

Action Response

data
objectRequired
error
string
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
integerRequired

Action Response

data
objectRequired
error
string
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
integerRequired
merge_request_iid
integerRequired

Action Response

data
objectRequired
error
string
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
integerRequired

Action Response

data
objectRequired
error
string
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
integerRequired
user_id
integerRequired

Action Response

data
objectRequired
error
string
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
integerRequired
user_id
integerRequired

Action Response

data
objectRequired
error
string
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
string
approved_by_ids
array
approver_ids
array
assignee_id
integer
author_id
integer
author_username
string
created_after
string
created_before
string
deployed_after
string
deployed_before
string
environment
string
id
integerRequired
iids[]
array
labels
string
merge_user_id
integer
merge_user_username
string
milestone
string
my_reaction_emoji
string
not_filter
object
order_by
string
page
integer
per_page
integer
reviewer_id
integer
reviewer_username
string
scope
string
search
string
sort
string
source_branch
string
state
string
target_branch
string
updated_after
string
updated_before
string
view
string
wip
string
with_labels_details
boolean
with_merge_status_recheck
boolean

Action Response

data
objectRequired
error
string
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
integerRequired
merge_request_iid
integerRequired

Action Response

data
objectRequired
error
string
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
integerRequired
regex
string
search
string

Action Response

data
objectRequired
error
string
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
integerRequired
sha
stringRequired
stats
booleanDefaults to True

Action Response

data
objectRequired
error
string
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
integerRequired

Action Response

data
objectRequired
error
string
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
string
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
string
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
string
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
string
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
string
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
string
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
integerRequired
page
integer
per_page
integer

Action Response

data
objectRequired
error
string
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
integerRequired
page
integer
per_page
integer
query
string
show_seat_info
boolean
state
string
user_ids
array

Action Response

data
objectRequired
error
string
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
integerRequired
page
integer
per_page
integer
search
string
sort
string

Action Response

data
objectRequired
error
string
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
boolean
id
integerRequired
include_inherited
boolean
page
integer
per_page
integer
query
string
relations
array
skip_users
array
sort
string
two_factor
string

Action Response

data
objectRequired
error
string
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
integerRequired
page
integer
per_page
integer

Action Response

data
objectRequired
error
string
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
integerRequired
include_retried
boolean
pipeline_id
integerRequired
scope
string

Action Response

data
objectRequired
error
string
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
integerRequired
page
integer
per_page
integer
search
string
shared_min_access_level
integer
shared_visible_only
boolean
skip_groups
array
with_shared
boolean

Action Response

data
objectRequired
error
string
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
integerRequired
page
integer
per_page
integer

Action Response

data
objectRequired
error
string
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
string
created_before
string
id
integerRequired
name
string
order_by
stringDefaults to id
page
integer
per_page
integer
ref
string
scope
string
sha
string
sort
stringDefaults to desc
source
string
status
string
updated_after
string
updated_before
string
username
string
yaml_errors
boolean

Action Response

data
objectRequired
error
string
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
integerRequired
page
integer
per_page
integer
search
string
skip_groups
array

Action Response

data
objectRequired
error
string
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
integerRequired
order_by
string
page
integer
per_page
integer
search
string
sort
string

Action Response

data
objectRequired
error
string
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
integerRequired
search
string

Action Response

data
objectRequired
error
string
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
boolean
author
string
first_parent
boolean
order
string
path
string
project_id
integerRequired
ref_name
string
since
string
trailers
boolean
until
string
with_stats
boolean

Action Response

data
objectRequired
error
string
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
boolean
id
integerRequired
id_after
integer
id_before
integer
membership
boolean
min_access_level
integer
order_by
string
owned
boolean
page
integer
per_page
integer
search
string
simple
boolean
sort
string
starred
boolean
statistics
boolean
updated_after
string
updated_before
string
visibility
string
with_custom_attributes
boolean
with_issues_enabled
boolean
with_merge_requests_enabled
boolean
with_programming_language
string

Action Response

data
objectRequired
error
string
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
string
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
string
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
string
emoji
string
message
string

Action Response

data
objectRequired
error
string
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
string
group_access
integerRequired
group_id
integerRequired
id
integerRequired

Action Response

data
objectRequired
error
string
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
integerRequired
task
string

Action Response

data
objectRequired
error
string
successful
booleanRequired