Skip to main content
Glama

get_project

Retrieve detailed information about a GitLab project by specifying its ID or path, enabling users to access project data for management and integration purposes.

Instructions

取得 GitLab 專案詳細資訊

Args: project_id: 專案 ID(數字)或路徑(如 group/project)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool registration and handler implementation for 'get_project'. It takes project_id as input and returns a string formatted with project details.
    @mcp.tool()
    def get_project(project_id: int | str) -> str:
        """取得 GitLab 專案詳細資訊
    
        Args:
            project_id: 專案 ID(數字)或路徑(如 group/project)
        """
        try:
            client = get_client()
            p = client.get_project(project_id)
            return f"""專案: {p['name']} [{p['id']}]
    路徑: {p['path_with_namespace']}
    描述: {p.get('description') or '無'}
    預設分支: {p.get('default_branch', 'N/A')}
    可見性: {p.get('visibility', 'N/A')}
    建立時間: {p.get('created_at', 'N/A')}
    最後活動: {p.get('last_activity_at', 'N/A')}
    星標數: {p.get('star_count', 0)} | Fork 數: {p.get('forks_count', 0)}
    網址: {p.get('web_url', '')}"""
        except GitLabAPIError as e:
  • Actual GitLab API interaction logic for 'get_project' in the GitLabClient class. It resolves the project ID and fetches the project JSON data.
    def get_project(self, project_id: int | str) -> dict:
        """GET /projects/:id"""
        pid = self._resolve_project_id(project_id)
        return self._get_json(f"/projects/{pid}")
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 of behavioral disclosure. It states the tool retrieves detailed information but doesn't describe what 'detailed information' includes (e.g., metadata, settings, statistics), whether it's a read-only operation, potential errors (e.g., invalid project_id, access denied), or response format. For a tool with no annotation coverage, this leaves significant gaps in understanding its behavior.

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

Conciseness4/5

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

The description is appropriately concise and front-loaded, with the core purpose stated first ('取得 GitLab 專案詳細資訊') followed by parameter details. Both sentences are necessary and add value—no redundant or verbose language. However, the structure could be slightly improved by integrating the parameter explanation more seamlessly rather than as a separate 'Args:' section.

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 low complexity (1 parameter) and the presence of an output schema (which should define return values), the description is minimally adequate. It covers the purpose and parameter semantics but lacks behavioral details (e.g., error handling, authentication needs) and usage guidelines. With no annotations, it doesn't fully compensate for these gaps, making it incomplete for reliable agent use.

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 description adds meaningful context beyond the input schema, which has 0% description coverage. It explains that 'project_id' can be either a numeric ID or a path string (e.g., 'group/project'), clarifying the parameter's purpose and acceptable formats. This compensates well for the schema's lack of descriptions, though it doesn't detail constraints like path syntax rules.

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 action ('取得' meaning 'get' or 'retrieve') and resource ('GitLab 專案詳細資訊' meaning 'GitLab project detailed information'), making the purpose immediately understandable. It distinguishes itself from siblings like 'list_projects' by focusing on retrieving detailed information for a specific project rather than listing multiple projects. However, it doesn't explicitly contrast with other get_* tools (e.g., get_branch, get_merge_request) beyond the resource type.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., authentication, project access), differentiate from similar tools like 'list_projects' for bulk retrieval, or specify use cases (e.g., for viewing project settings, metadata). The agent must infer usage from the tool name and context alone.

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

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