| name | gitlab |
| description | Agent-callable GitLab tools — manage issues and merge requests, review diffs, commit files, run pipelines, and search. Use when the user mentions GitLab or wants to review or merge an MR, commit code, run CI, or manage issues — even if they don't name GitLab explicitly. |
| license | Elastic-2.0 |
| compatibility | Run `npm install --omit=dev` in this directory, then `node cli.js`. The TypeScript source needs Node.js 22.18+; on older Node, run `cli.js` for build-it-yourself / prebuilt / alternative-runtime options. |
| metadata | {"source":"https://github.com/zapier/connectors/blob/main/apps/gitlab/SKILL.md","title":"Gitlab","api-docs":"https://docs.gitlab.com/api/rest/","zapier-app-key":"GitLabCLIAPI"} |
Gitlab
Agent-callable tools for GitLab, the DevOps platform for source code, merge requests, and CI/CD. The connector wraps the GitLab REST API v4 (with one GraphQL island — the Work Items surface — reached through POST /api/graphql), giving an agent the ability to read and drive projects, issues, merge requests, repository contents, and pipelines. It is centered on the merge-request review loop and repository authoring: read an MR and its diffs and discussions, comment or approve, commit file changes atomically, and run or inspect CI. It targets GitLab SaaS (gitlab.com) by default; the host is configurable for self-managed and GitLab Dedicated instances.
Independent, unofficial connector for Gitlab. Not affiliated with, endorsed by, or sponsored by Gitlab. "Gitlab" is a trademark of its owner, used only to identify the service this connector works with.
When to use this
- An agent needs to drive the merge-request review loop: list and read MRs, fetch their diffs, commits, notes, and threaded discussions, comment inline on a diff line, approve or unapprove, and merge.
- An agent needs to author repository changes: create a branch, commit many files in one atomic commit, read files and the repository tree, list commits, and compare two refs.
- An agent needs to manage issues (REST): create, update, comment on, and close/reopen them — or manage work items like epics, tasks, and objectives (GraphQL): create, update, and close/reopen.
- An agent needs to run and inspect CI/CD: trigger, list, get, retry, or cancel pipelines; list jobs, read a job log, and play a manual job.
- An agent needs to search — globally, within a project, or within a group — across issues, merge requests, code, commits, users, and more, and resolve project, user, label, and milestone ids before writing.
Setup
This is an agentskills.io skill.
If the connector has not been installed as a skill yet, install it first with npx skills add zapier/connectors --skill gitlab (or your harness's own skill-install mechanism), then continue here. Installing the skill copies these files, not dependencies. Before running the CLI, a local MCP server, or zapier-sdk auth commands, run npm install --omit=dev here once. Importing the published package as a dependency in your own project instead? That npm install already resolves everything — see references/use-as-sdk.md.
Want the actual repo source instead — to browse references/, run this connector's tests, or hack on it? See README.md for a scoped git clone.
The connector runs on Node.js 22.18+. Pick the reference that matches how you're running it, and load it before doing anything else:
| You have... | Load |
|---|
An MCP-aware client — tools may already be loaded (e.g. mcp__gitlab__<tool>), or you can register a local server yourself (or guide the user to) | references/use-as-mcp.md |
Terminal / subprocess access (you can run node) | references/use-as-cli.md |
| Only your own code, importing this package as a dependency | references/use-as-sdk.md |
| No tool access, no terminal, no ability to import this package — you write your own code that calls the Gitlab API directly (e.g. a code-execution sandbox) | references/use-as-recipe.md |
Scripts
All 47 scripts use the single connection gitlab. Project-scoped tools take a projectId (numeric id or URL-encoded group/project path); issues and MRs are addressed by their project-scoped iid, not the global id. The script's inputSchema / outputSchema (Zod) inside the file is the source of truth for its contract.
Projects & search
| Script | Script name | Connections | Description |
|---|
scripts/listProjects.ts | listProjects | gitlab | List or search projects the token can see (resolves projectId). |
scripts/getProject.ts | getProject | gitlab | Get one project's metadata by id or path (incl. default_branch). |
scripts/search.ts | search | gitlab | Search globally across projects, issues, MRs, milestones, users, code, or commits. |
scripts/searchProject.ts | searchProject | gitlab | Search within one project across issues, MRs, milestones, users, code, or commits. |
scripts/searchGroup.ts | searchGroup | gitlab | Search within one group across projects, issues, MRs, milestones, users, code, or commits. |
Issues
Merge requests
Repository
CI/CD
Work items (GraphQL)
Metadata & resolvers
Disambiguation & refusals
This connector resolves names to ids, then writes. Two situations trip up an action-biased agent — handle both before you write.
Before writing to a record you looked up by name — count how many returned records match the name the user gave exactly (case-insensitive). This applies to projects looked up by path/name via listProjects, users looked up by username via findUsers, and labels or milestones via listLabels / listMilestones:
- One exact match (even among other fuzzy hits) → use it. Don't ask for confirmation you don't need.
- No exact match but one clear fuzzy hit → use it.
- Two or more that tie (two projects both pathed
.../api, two users both named "Jordan Lee", two labels both "backend") → stop. List them with a distinguishing field (id + path_with_namespace / username / description) and ask which one. Never pick one yourself and write against it.
Before fulfilling a request, check that a script actually does it:
- A script does it → use it.
- No script does it → say plainly it's unsupported and stop. There are no tools for project, group, or instance administration (creating or deleting a project, managing members, protected branches, runners, webhooks, or pipeline triggers) — these are out of scope. Work items (epics/tasks/objectives) require a Premium/Ultimate project — if a work-item call returns a tier/availability error, say so plainly and stop; don't fake success. Don't substitute a different script and call it done, and never report success for an action you didn't perform.
Auth
Every shape passes auth as one connection selector, not the secret — a [<resolver>:]<value> string. Every connector accepts zapier:<connection-id> (Zapier-managed auth — routes through Zapier's auth, retries, and governance layer); some also accept one or more direct-token resolvers (naming and count vary per connector) — check this connector's own resolvers rather than assuming. The <resolver>: prefix is optional; a bare value goes to the first resolver that claims it — a UUID-shaped bare value always claims zapier:. Each script declares the connections it needs and the resolvers each accepts. The exact syntax for passing a connection (and how to see this connector's resolver list) differs by shape — see the reference you loaded above.
Checking what's already configured first? Don't dump environment values to do it — env or env | grep <name> prints the value along with the name, leaking a live credential into the transcript if one is set. Check names only (env | cut -d= -f1 | grep -i <name>) or test a known name directly ([ -n "$VAR_NAME" ]).
No connection yet? Pick one — and follow the reference's own flow to obtain it; never just ask the user for a connection id or token as if they already have one memorized:
Output format
Every script returns a { data, meta } envelope:
data — the script's result (the shape its outputSchema declares; see the reference you loaded above for how to inspect a script's exact schema in your shape).
meta.outputDataValidation — what validating data did:
{ skipped: false, droppedPaths: null } — validated, nothing removed.
{ skipped: false, droppedPaths: [...], instruction } — validated, but those paths were stripped from data: fields the script returned from the API that the outputSchema doesn't declare. If you need them, re-run with output validation skipped.
{ skipped: true } — validation was bypassed; data is the raw, unchecked script output.
Reading dropped fields / skipOutputDataValidation. To receive the raw, unvalidated result, opt out of output validation (the exact syntax differs by shape — see the reference you loaded above). Input validation is never skipped.
Trimming the result / filterOutputData. To shrink a large result down to the fields you need, pass a jq expression that post-processes data (again, exact syntax per shape). The jq runs against data only, NOT the { data, meta } envelope, so write it rooted at data (run the script's --help — or your shape's equivalent — to see its output schema). The transformed value replaces data, meta is preserved, and the result is NOT re-validated against the output schema.
References
Load the matching reference file before working in that area:
| Reference | Covers | Load it when |
|---|
references/gitlab-api-gotchas.md | Vendor behaviors that break a naive caller: PRIVATE-TOKEN vs OAuth Bearer auth and api/read_api scopes, numeric-id-vs-encoded-path and iid-vs-global-id, the JSON error shape and status codes, offset vs keyset pagination, gitlab.com rate limits, the singular POST .../pipeline, merge 405-when-not-mergeable and the sha guard, GraphQL-only work items. | Before any write, or when a call returns a non-2xx status, a 405 on merge, an empty/errored pipeline or work-item call, or an unexpected pagination result. |
references/gitlab-formatting.md | GitLab Flavored Markdown: blank-line paragraph breaks, #/!/@ references, task lists, tables, fenced code highlighting. | When composing a GitLab issue or merge-request description, a work-item body, or a note/diff comment. |