unshare_project_with_group
Remove a group's access to a GitLab project by specifying project and group IDs.
Instructions
Remove project sharing with a group.
Args:
project_id: GitLab project ID
group_id: Group ID to unshare from
token: GitLab Personal Access Token (optional)
ctx: MCP context (automatically injected)Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | ||
| group_id | Yes | ||
| token | No | ||
| ctx | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- The handler function for the 'unshare_project_with_group' tool. It removes sharing of a project with a group by sending a DELETE request to the GitLab API endpoint /projects/{project_id}/share/{group_id}.
@mcp.tool() async def unshare_project_with_group(project_id: int, group_id: int, token: str = None, ctx=None) -> str: """Remove project sharing with a group. Args: project_id: GitLab project ID group_id: Group ID to unshare from token: GitLab Personal Access Token (optional) ctx: MCP context (automatically injected) """ result = await make_gitlab_request(f"/projects/{project_id}/share/{group_id}", "DELETE", ctx=ctx, token=token) if isinstance(result, dict) and "error" in result: return f"Error unsharing project: {result['error']}" return f"Project unshared from group {group_id}" - gitlab_clone_mcp_server/server.py:1315-1316 (registration)The tool is registered via the @mcp.tool() decorator on line 1315, which is part of the FastMCP framework.
@mcp.tool() async def unshare_project_with_group(project_id: int, group_id: int, token: str = None, ctx=None) -> str: