Skip to main content
Glama

gitlab_search_in_project

Search within a GitLab project for issues, MRs, commits, code, or wiki pages using specified scopes. Retrieve matching results with highlights based on your query. Simplify project navigation by targeting specific content types directly.

Instructions

Search within a project Returns: Results from specified scope Use when: Finding issues, MRs, code, wiki pages Required: Scope (what to search in)

Scopes:

  • 'issues': Search issue titles/descriptions

  • 'merge_requests': Search MR titles/descriptions

  • 'commits': Search commit messages

  • 'blobs': Search file contents

  • 'wiki_blobs': Search wiki pages

Example: Search for "login" in issues Returns matching issues with highlights

Related tools:

  • gitlab_search_projects: Search across projects

  • Specific list tools for each type

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoPage number for pagination Type: integer Range: ≥1 Default: 1 Example: 3 (to get the third page of results) Note: Use with per_page to navigate large result sets
per_pageNoNumber of results per page Type: integer Range: 1-100 Default: 20 Example: 50 (for faster browsing) Tip: Use smaller values (10-20) for detailed operations, larger (50-100) for listing
project_idNoProject identifier (auto-detected if not provided) Type: integer OR string Format: numeric ID or 'namespace/project' Optional: Yes - auto-detects from current git repository Examples: - 12345 (numeric ID) - 'gitlab-org/gitlab' (namespace/project path) - 'my-group/my-subgroup/my-project' (nested groups) Note: If in a git repo with GitLab remote, this can be omitted
scopeYesSearch scope Type: string (enum) Options: - 'issues': Search in issues - 'merge_requests': Search in MRs - 'milestones': Search in milestones - 'wiki_blobs': Search in wiki pages - 'commits': Search in commit messages - 'blobs': Search in file contents - 'users': Search for users Required: Yes Example: 'issues' to find issues mentioning a term
searchYesSearch query Type: string Matching: Case-insensitive, partial matching Searches in: Project names and descriptions Examples: - 'frontend' (finds 'frontend-app', 'old-frontend', etc.) - 'API' (matches 'api', 'API', 'GraphQL-API', etc.) Tip: Use specific terms for better results

Implementation Reference

  • Main handler function implementing the gitlab_search_in_project tool. Extracts parameters, detects project if needed, and calls GitLabClient.search_in_project.
    def handle_search_in_project(client: GitLabClient, arguments: Optional[Dict[str, Any]]) -> Dict[str, Any]: """Handle searching in project""" project_id = require_project_id(client, arguments) scope = require_argument(arguments, "scope") search = require_argument(arguments, "search") per_page = get_argument(arguments, "per_page", DEFAULT_PAGE_SIZE) page = get_argument(arguments, "page", 1) return client.search_in_project(project_id, scope, search, per_page, page)
  • Registration of the handler function in the TOOL_HANDLERS dictionary, which is used by server.py to dispatch tool calls.
    TOOL_SEARCH_PROJECTS: handle_search_projects, TOOL_SEARCH_IN_PROJECT: handle_search_in_project,
  • Tool schema definition returned by @server.list_tools(), including input schema, parameters, and description.
    types.Tool( name="gitlab_search_in_project", description=desc.DESC_SEARCH_IN_PROJECT, inputSchema={ "type": "object", "properties": { "project_id": {"type": "string", "description": desc.DESC_PROJECT_ID}, "scope": {"type": "string", "description": desc.DESC_SEARCH_SCOPE, "enum": ["issues", "merge_requests", "milestones", "notes", "wiki_blobs", "commits", "blobs"]}, "search": {"type": "string", "description": desc.DESC_SEARCH_TERM}, "per_page": {"type": "integer", "description": desc.DESC_PER_PAGE, "default": DEFAULT_PAGE_SIZE, "minimum": 1, "maximum": MAX_PAGE_SIZE}, "page": {"type": "integer", "description": desc.DESC_PAGE_NUMBER, "default": 1, "minimum": 1} }, "required": ["scope", "search"] } ),
  • Additional schema definition in tool_definitions.py (potentially used or reference).
    types.Tool( name=TOOL_SEARCH_IN_PROJECT, description=desc.DESC_SEARCH_IN_PROJECT, inputSchema={ "type": "object", "properties": { "project_id": {"type": "string", "description": desc.DESC_PROJECT_ID}, "scope": {"type": "string", "description": desc.DESC_SEARCH_SCOPE, "enum": ["issues", "merge_requests", "milestones", "notes", "wiki_blobs", "commits", "blobs"]}, "search": {"type": "string", "description": desc.DESC_SEARCH_TERM}, "per_page": {"type": "integer", "description": desc.DESC_PER_PAGE, "default": DEFAULT_PAGE_SIZE, "minimum": 1, "maximum": MAX_PAGE_SIZE}, "page": {"type": "integer", "description": desc.DESC_PAGE_NUMBER, "default": 1, "minimum": 1} }, "required": ["scope", "search"] } ),
  • Constant definition for the tool name used across files.
    TOOL_SEARCH_IN_PROJECT = "gitlab_search_in_project"

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Vijay-Duke/mcp-gitlab'

If you have feedback or need assistance with the MCP directory API, please join our Discord server