GitLab
Read GitLab projects, issues, and merge requests — and open new issues — via the GitLab REST API v4. Pure standard-library Python (urllib), no dependencies, credential-free (token passed as an input).
What it does
Branches on operation and calls the corresponding documented GitLab endpoint,
authenticating with the PRIVATE-TOKEN header. The raw JSON response body is
returned as result, and the HTTP status as status.
Operations
| operation | Method & endpoint | Required inputs |
|---|---|---|
list-projects |
GET /projects?membership=true |
— |
list-issues |
GET /projects/{projectId}/issues |
projectId |
create-issue |
POST /projects/{projectId}/issues |
projectId, title |
list-merge-requests |
GET /projects/{projectId}/merge_requests |
projectId |
projectId is the numeric project ID or the URL-encoded path (e.g.
mygroup/myproject — the tool URL-encodes it for you). state filters
list-issues (opened/closed/all) and list-merge-requests
(opened/closed/merged/all); it defaults to opened. search narrows
list-projects. Self-managed GitLab? Set baseUrl to your instance's
https://<host>/api/v4.
API key setup
- Go to GitLab → User Settings → Access Tokens (https://gitlab.com/-/user_settings/personal_access_tokens).
- Create a personal access token. Select the
apiscope (full read/write), orread_apiif you only need the read operations. - Copy the token and pass it as the
apiKeyinput. It is sent as thePRIVATE-TOKENHTTP header on every request.
Examples
List open issues in a project:
{
"apiKey": "glpat-xxxxxxxxxxxxxxxxxxxx",
"operation": "list-issues",
"projectId": "mygroup/myproject",
"state": "opened"
}
Open a new issue:
{
"apiKey": "glpat-xxxxxxxxxxxxxxxxxxxx",
"operation": "create-issue",
"projectId": "12345",
"title": "Login page returns 500 on submit",
"description": "Steps to reproduce...",
"labels": "bug,backend"
}
Publishes
The keys a later task may reference as {{taskName.key}}. Referencing anything not listed here resolves to nothing at run time.
errorokoperationresultstatus
Input Properties
Every property this tool accepts, from its own tool.iml.
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
apiKey |
string | yes | — | GitLab personal access token. Create at https://gitlab.com/-/user_settings/personal_access_tokens — needs the 'api' scope (or 'read_api' for read-only operations). Sent as the PRIVATE-TOKEN header. |
operation |
string | yes | — | One of: list-projects, list-issues, create-issue, list-merge-requests |
projectId |
string | no | — | Project ID (numeric) or URL-encoded path, e.g. '12345' or 'mygroup/myproject'. Required for list-issues, create-issue, list-merge-requests. |
title |
string | no | — | Issue title — required for create-issue. |
description |
string | no | — | Issue description/body — optional for create-issue. |
labels |
string | no | — | Comma-separated label names to attach when creating an issue — optional. |
state |
string | no | opened |
Filter for list-issues / list-merge-requests: opened, closed, merged (MRs), or all. Defaults to opened. |
search |
string | no | — | Optional search term for list-projects (matches name, path, or description). |
baseUrl |
string | no | https://gitlab.com/api/v4 |
API base URL — override for self-managed instances. Must end in /api/v4. |