View as Markdown
GitLab icon

GitLab ACTION

Search Merge Requests

Find merge requests whose title or description matches a search term. Use this when the user refers to a merge request by what it is about ("the MR about the Redis cache refactor", "the payments migration MR") rather than by number - it is the fastest way to turn a description into the iid that every other merge request tool needs. ALWAYS set Project (or Group) when you know which one the user means: a project-scoped search returns in well under a second, whereas an unscoped search scans every project the account can access and, on accounts that belong to many projects, can take tens of seconds and time out (HTTP 408). Leave both blank only when the project is genuinely unknown. Use List Merge Requests instead when there is no text to match and you only want to filter by state, author, reviewer or branch. Matching is case-insensitive substring, not fuzzy - prefer one or two distinctive words over a whole sentence. See the documentation
  • Action
  • Read only
  • OAuth
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's GitLab account once, then configure and run Search Merge Requests from your backend or agent.

import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "gitlab-search-merge-requests",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    gitlab: { authProvisionId: "apn_xxxxxxx" },
    search: "Search",
    projectId: "Project",
  },
})

console.log(result)

SCHEMA

Inputs

Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.

Search Merge Requests inputs
Property Type Description
search Search string
Text to match against the merge request title and/or description (case-insensitive substring). Use a few distinctive keywords, e.g. redis cache rather than the MR that refactors the Redis cache layer.
Required
projectId Project string
Limit the search to this project, given as a path (group/project, e.g. backend/payments) or a numeric project ID. Mutually exclusive with Group.
Optional
groupId Group string
Limit the search to every project in this group, given as a full path or a numeric group ID. Cannot be combined with Project — setting both is rejected.
Optional
searchIn Search In string
Which fields to match against. Defaults to title,description. Narrow to title when the user is quoting an MR name and description matches would be noise.
Optional
state State string
Return merge requests in this state. Defaults to opened. Set to all when the merge request being looked for may already be merged or closed — a common case when searching by description.
Optional
scope Scope string
Narrow the results by the authenticated user's relationship to the merge request. reviews_for_me answers "what is waiting on my review?", assigned_to_me "what is assigned to me?", and created_by_me "what did I open?". Defaults to all.
Optional
maxResults Max Results integer
Maximum number of matches to return in total, paginating as needed. Defaults to 20, which is usually plenty for a lookup.
Optional
detail Detail string
How much of each record to return. summary (the default) returns the fields needed to identify and triage a merge request and is much cheaper to read. Use full only when you need a field the summary omits.
Optional

REFERENCE

Tool details

Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.

Registry key
gitlab-search-merge-requests
Version
0.0.1
App
GitLab
Authentication
OAuth
Read-only
Yes
Destructive
No
Open world
Yes