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)curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
-H "Content-Type: application/json" \
-H "X-PD-Environment: production" \
-H "Authorization: Bearer {access_token}" \
-d '{
"external_user_id": "{external_user_id}",
"id": "gitlab-search-merge-requests",
"configured_props": {
"gitlab": { "authProvisionId": "apn_xxxxxxx" },
"search": "Search",
"projectId": "Project"
}
}'// accessToken: mint a short-lived token with the Connect SDK — see the MCP guide
const transport = new StreamableHTTPClientTransport(
new URL("https://remote.mcp.pipedream.net/v3"),
{
requestInit: {
headers: {
Authorization: `Bearer ${accessToken}`,
"x-pd-project-id": "{project_id}",
"x-pd-environment": "production",
"x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
"x-pd-app-slug": "gitlab",
},
},
},
)
const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)
const { tools } = await mcp.listTools()
// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
name: "gitlab-search-merge-requests",
arguments: {
search: "Search",
projectId: "Project",
},
})SCHEMA
Inputs
Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.
| 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
- Source
- View on GitHub ↗