Search

June 3, 2026 ยท View on GitHub

Code search across all visible projects, a specific project, or a specific group.

!!! note "Feature toggle" Opt-in. Enable via GITLAB_TOOLSETS=search (or GITLAB_TOOLSETS=all), list individual tools in GITLAB_TOOLS=, or activate at runtime with the discover_tools MCP tool.

Tools in this group


search_code

๐Ÿ“– Read-only

Search for code across all projects (requires advanced search or Zoekt)

Parameters

ParameterTypeRequiredDescription
searchstringโœ“Code search query string. On instances with exact code search (Zoekt), the query supports rich inline syntax: "class foo" (exact match), foo file:.js$ (file pattern), foo lang:ruby (language), sym:foo (symbol search), foo -bar (negation), case:yes (case-sensitive). When using Zoekt inline filters, prefer them over the separate filename/path/extension params which are for basic search.
filenamestringFilter by filename (supports * wildcard, e.g. '*.ts')
pathstringFilter by file path (supports * wildcard, e.g. 'src/utils/*')
extensionstringFilter by file extension without dot (e.g. 'py', 'ts')
pagenumberPage number for pagination (default: 1)
per_pagenumberNumber of items per page (max: 100, default: 20)

search_project_code

๐Ÿ“– Read-only

Search for code within a specific project (requires advanced search or Zoekt)

Parameters

ParameterTypeRequiredDescription
project_idstringโœ“Project ID or complete URL-encoded path to project
searchstringโœ“Code search query string. On instances with exact code search (Zoekt), the query supports rich inline syntax: "class foo" (exact match), foo file:.js$ (file pattern), foo lang:ruby (language), sym:foo (symbol search), foo -bar (negation), case:yes (case-sensitive). When using Zoekt inline filters, prefer them over the separate filename/path/extension params which are for basic search.
filenamestringFilter by filename (supports * wildcard, e.g. '*.ts')
pathstringFilter by file path (supports * wildcard, e.g. 'src/utils/*')
extensionstringFilter by file extension without dot (e.g. 'py', 'ts')
refstringBranch or tag to search in (defaults to default branch)
pagenumberPage number for pagination (default: 1)
per_pagenumberNumber of items per page (max: 100, default: 20)

search_group_code

๐Ÿ“– Read-only

Search for code within a specific group (requires advanced search or Zoekt)

Parameters

ParameterTypeRequiredDescription
group_idstringโœ“Group ID or URL-encoded path
searchstringโœ“Code search query string. On instances with exact code search (Zoekt), the query supports rich inline syntax: "class foo" (exact match), foo file:.js$ (file pattern), foo lang:ruby (language), sym:foo (symbol search), foo -bar (negation), case:yes (case-sensitive). When using Zoekt inline filters, prefer them over the separate filename/path/extension params which are for basic search.
filenamestringFilter by filename (supports * wildcard, e.g. '*.ts')
pathstringFilter by file path (supports * wildcard, e.g. 'src/utils/*')
extensionstringFilter by file extension without dot (e.g. 'py', 'ts')
pagenumberPage number for pagination (default: 1)
per_pagenumberNumber of items per page (max: 100, default: 20)