Skip to main content
Glama

GitLab MCP Code Review

by ffpy

search_projects

Find GitLab projects by name to identify repositories for code review, analysis, and merge request management.

Instructions

Search for GitLab projects by name. Args: project_name: The name of the project to search for. If None, returns all projects. Returns: A list of projects matching the search criteria.

Input Schema

NameRequiredDescriptionDefault
project_nameNo

Input Schema (JSON Schema)

{ "properties": { "project_name": { "default": null, "title": "Project Name", "type": "string" } }, "type": "object" }

Implementation Reference

  • The main handler function for the 'search_projects' tool. It is decorated with @mcp.tool(), which registers it with the MCP server. The function retrieves the GitLab client from context, searches for projects by name (or lists all if None), and returns their details as dictionaries.
    @mcp.tool() def search_projects(ctx: Context, project_name: str = None) -> List[Dict[str, Any]]: """ Search for GitLab projects by name. Args: project_name: The name of the project to search for. If None, returns all projects. Returns: A list of projects matching the search criteria. """ gl = ctx.request_context.lifespan_context projects = gl.projects.list(search=project_name) return [p.asdict() for p in projects]
  • server.py:395-395 (registration)
    The @mcp.tool() decorator registers the search_projects function as an MCP tool.
    @mcp.tool()

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/ffpy/gitlab-mcp-code-review'

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