Skip to main content
Glama

gitlab_list_all_projects

Retrieve all accessible GitLab projects to view available repositories and manage development workflows.

Instructions

Lists all accessible GitLab projects. (Try to use list_projects_by_name as it is more efficient)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler for the 'gitlab_list_all_projects' tool that checks if GitLab service is initialized, calls listProjects on the service, and returns the JSON-stringified result as text content.
    case 'gitlab_list_all_projects': {
      if (!gitlabService) {
        throw new Error('GitLab service is not initialized.');
      }
      const result = await gitlabService.listProjects();
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
  • Core implementation of listing all accessible GitLab projects using the API endpoint with caching. Maps full project data to simplified GitLabProject objects.
    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;
    }
  • src/index.ts:229-236 (registration)
    Registration of the 'gitlab_list_all_projects' tool in the allTools array, including name, description, and empty input schema (no parameters required).
      name: 'gitlab_list_all_projects',
      description:
        'Lists all accessible GitLab projects. (Try to use list_projects_by_name as it is more efficient)',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },
  • TypeScript interface defining the structure of GitLabProject objects returned by the listProjects method.
    export interface GitLabProject {
      id: number;
      name: string;
      name_with_namespace: string;
      path_with_namespace: string;
      last_activity_at: string;
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It mentions the tool lists 'all accessible' projects, implying scope, but lacks details on permissions, pagination, rate limits, or output format. For a list operation with zero annotation coverage, this leaves significant behavioral gaps.

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 two sentences with zero waste: the first states the purpose, and the second provides crucial usage guidance. It is front-loaded and efficiently structured.

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

Completeness3/5

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

Given the tool's simplicity (0 parameters, no output schema, no annotations), the description is adequate but could be more complete. It covers purpose and guidelines well but lacks behavioral details like output structure or limitations, which would help an agent use it correctly.

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

Parameters4/5

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

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description doesn't add param info, which is appropriate, but it could have mentioned implicit aspects like authentication or filters. Baseline is 4 for zero parameters.

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 ('all accessible GitLab projects'), making the purpose unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'gitlab_list_projects_by_name' beyond mentioning it as an alternative, which slightly reduces specificity.

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

Usage Guidelines5/5

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

The description explicitly provides usage guidance by stating 'Try to use list_projects_by_name as it is more efficient,' which clearly indicates when to prefer an alternative tool. This is a direct and helpful comparison to a sibling tool.

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