Skip to main content
Glama

gitlab_get_project

Retrieve detailed information about a specific GitLab project by providing its ID or URL-encoded path. Ideal for managing repositories and CI/CD pipelines efficiently.

Instructions

Get details of a specific GitLab project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYesThe ID or URL-encoded path of the project

Implementation Reference

  • The handler function that implements the core logic of the gitlab_get_project tool by calling the GitLab API to retrieve project details.
    /**
     * Get project details handler
     */
    export const getProject: ToolHandler = async (params, context) => {
      const { project_id } = params.arguments || {};
      if (!project_id) {
        throw new McpError(ErrorCode.InvalidParams, 'project_id is required');
      }
      
      const response = await context.axiosInstance.get(`/projects/${encodeURIComponent(String(project_id))}`);
      return formatResponse(response.data);
    };
  • Defines the input schema and description for the gitlab_get_project tool.
    {
      name: 'gitlab_get_project',
      description: 'Get details of a specific GitLab project',
      inputSchema: {
        type: 'object',
        properties: {
          project_id: {
            type: 'string',
            description: 'The ID or URL-encoded path of the project'
          }
        },
        required: ['project_id']
      }
    },
  • Registers the 'gitlab_get_project' tool name mapped to the repoHandlers.getProject handler function in the tool registry.
    gitlab_get_project: repoHandlers.getProject,
  • Imports the repository handlers module containing the getProject function.
    import * as repoHandlers from "../handlers/repository-handlers.js";

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/rifqi96/mcp-gitlab'

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