Skip to main content
Glama

gitlab_list_project_members_by_project_name

Retrieve all contributors for a specific GitLab project using its name. This tool helps identify team members and their roles within a project.

Instructions

Lists all members (contributors) of a given GitLab project by project name.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectNameYesThe name of the GitLab project.

Implementation Reference

  • The primary handler function implementing the tool logic. It fetches the list of projects, finds the one matching the given project name, and then retrieves its members using the helper method.
    async listProjectMembersByProjectName(projectName: string): Promise<any[]> {
      const projects = await this.listProjects();
      const project = projects.find((p) => p.name === projectName);
      if (!project) {
        throw new Error(`Project with name ${projectName} not found.`);
      }
      return this.listProjectMembers(project.path_with_namespace);
    }
  • src/index.ts:199-212 (registration)
    Registers the tool in the MCP server's tool list, including name, description, and input schema definition.
      name: 'gitlab_list_project_members_by_project_name',
      description:
        'Lists all members (contributors) of a given GitLab project by project name.',
      inputSchema: {
        type: 'object',
        properties: {
          projectName: {
            type: 'string',
            description: 'The name of the GitLab project.',
          },
        },
        required: ['projectName'],
      },
    },
  • The MCP server request handler (dispatch) that extracts arguments and invokes the GitLabService handler method.
    case 'gitlab_list_project_members_by_project_name': {
      if (!gitlabService) {
        throw new Error('GitLab service is not initialized.');
      }
      const { projectName } = args as { projectName: string };
      const result =
        await gitlabService.listProjectMembersByProjectName(projectName);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
    }
  • Supporting helper method called by the main handler to fetch project members via GitLab API endpoint /members/all.
    async listProjectMembers(projectPath: string): Promise<any[]> {
      const encodedProjectPath = encodeURIComponent(projectPath);
      return this.callGitLabApi<any[]>(
        `projects/${encodedProjectPath}/members/all`,
      );
    }
  • Supporting helper method to list all accessible projects with caching, used to find the project by name.
    async listProjects(): Promise<GitLabProject[]> {
      if (
        this.projectCache &&
        Date.now() - this.projectCache.timestamp < this.CACHE_DURATION_MS
      ) {
        return this.projectCache.data;
      }
    
      const url = `projects?membership=true&min_access_level=30&order_by=last_activity_at&sort=desc&per_page=100`;
      const projects = await this.callGitLabApi<any[]>(url);
    
      const simplifiedProjects: GitLabProject[] = projects.map((project) => ({
        id: project.id,
        name: project.name,
        name_with_namespace: project.name_with_namespace,
        path_with_namespace: project.path_with_namespace,
        last_activity_at: project.last_activity_at,
        ssh_url_to_repo: project.ssh_url_to_repo,
        http_url_to_repo: project.http_url_to_repo,
        web_url: project.web_url,
        readme_url: project.readme_url,
        issue_branch_template: project.issue_branch_template,
        statistics: project.statistics,
        _links: project._links,
      }));
    
      this.projectCache = { data: simplifiedProjects, timestamp: Date.now() };
      return simplifiedProjects;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden but only states it lists members without detailing behavioral traits like pagination, rate limits, authentication needs, or output format. It mentions 'all members' but doesn't clarify if this includes inactive users or specific roles, leaving gaps in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste, front-loaded with the core action. It avoids redundancy and is appropriately sized for a simple list operation.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description is incomplete for a tool that likely returns a list of members. It doesn't explain return values, error handling, or important behavioral aspects like access controls, making it inadequate for full contextual understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents the 'projectName' parameter. The description adds minimal value by reiterating 'by project name' but doesn't provide additional semantics like format examples or constraints beyond what the schema offers.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Lists') and resource ('members of a given GitLab project'), specifying it's by project name. It distinguishes from sibling 'gitlab_list_project_members' by explicitly mentioning 'by project name', though both likely serve similar purposes with different parameters.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives like 'gitlab_list_project_members' or 'gitlab_get_user_activities' is provided. The description implies usage for listing project members but offers no context on prerequisites, permissions, or comparison with siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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/HainanZhao/mcp-gitlab-jira'

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