archive_project
Archive a GitLab project by specifying its project ID. This action sets the project to archived status, preventing modifications while preserving all data.
Instructions
Archive a project.
Args:
project_id: GitLab project ID
token: GitLab Personal Access Token (optional)
ctx: MCP context (automatically injected)Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | ||
| token | No | ||
| ctx | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- The archive_project tool handler. Decorated with @mcp.tool(), it takes a project_id and optional token, calls the GitLab API endpoint /projects/{project_id}/archive via POST, and returns a success or error message.
@mcp.tool() async def archive_project(project_id: int, token: str = None, ctx=None) -> str: """Archive a project. Args: project_id: GitLab project ID token: GitLab Personal Access Token (optional) ctx: MCP context (automatically injected) """ result = await make_gitlab_request(f"/projects/{project_id}/archive", "POST", ctx=ctx, token=token) if isinstance(result, dict) and "error" in result: return f"Error archiving project: {result['error']}" return f"Project {project_id} archived successfully" - gitlab_clone_mcp_server/server.py:706-706 (registration)The @mcp.tool() decorator on the archive_project function registers it as an MCP tool.
@mcp.tool()