Prerequisites
Install the required dependencies:GITLAB_BASE_URL is optional. If unset, https://gitlab.com is used.
Example
cookbook/91_tools/gitlab_tools.py
Toolkit Params
| Parameter | Type | Default | Description |
|---|---|---|---|
access_token | Optional[str] | None | GitLab access token. If not provided, uses GITLAB_ACCESS_TOKEN. |
base_url | Optional[str] | None | GitLab instance URL. If not provided, uses GITLAB_BASE_URL, then https://gitlab.com. |
timeout | float | 30 | HTTP timeout in seconds for API requests. |
enable_list_projects | bool | True | Register the list_projects tool. |
enable_get_projects | bool | True | Register the get_project tool. |
enable_list_merge_requests | bool | True | Register the list_merge_requests tool. |
enable_get_merge_request | bool | True | Register the get_merge_request tool. |
enable_list_issues | bool | True | Register the list_issues tool. |
include_tools | Optional[list[str]] | None | Optional inherited toolkit filter to include only specific tools. |
exclude_tools | Optional[list[str]] | None | Optional inherited toolkit filter to exclude specific tools. |
Toolkit Functions
| Function | Description |
|---|---|
list_projects | List projects visible to the authenticated user. Supports search, owned, membership, and pagination filters. |
get_project | Get details for one project by project ID or group/project path. |
list_merge_requests | List merge requests for a project with state, branch, author, and pagination filters. |
get_merge_request | Get details for one merge request by project and merge request IID. |
list_issues | List project issues with state, labels, author, assignee, search, and pagination filters. |
enable_* constructor toggles to register only selected GitLab tools. You can also use include_tools or exclude_tools to filter available tools. See selecting tools.