groupmembers

package
v2.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 28, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package groupmembers implements MCP tools for GitLab group member operations.

The package wraps the GitLab Members API for group membership:

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActionSpecs

func ActionSpecs(client *gitlabclient.Client) []toolutil.ActionSpec

ActionSpecs returns canonical specs for group member actions. The get, get_inherited, add, edit, remove, share, and unshare routes are projected into the dynamic, meta, individual, and audit surfaces by the action catalog (ADR-0004). Each spec carries action-specific discovery metadata (Usage, natural-language Aliases, canonical RelatedActions, ParameterGuidance, and an individual-tool Description) per the 1:1 audit R-META requirement.

func FormatBillableMembersMarkdown added in v2.3.0

func FormatBillableMembersMarkdown(out BillableMembersOutput) string

FormatBillableMembersMarkdown formats a list of billable group members as markdown.

func FormatBillableMembershipsMarkdown added in v2.3.0

func FormatBillableMembershipsMarkdown(out BillableMembershipsOutput) string

FormatBillableMembershipsMarkdown formats a billable member's memberships as markdown.

func FormatMemberMarkdown

func FormatMemberMarkdown(out Output) string

FormatMemberMarkdown formats a single group member as markdown.

func FormatShareMarkdown

func FormatShareMarkdown(out ShareOutput) string

FormatShareMarkdown formats a group share result as markdown.

func RemoveBillableMember added in v2.3.0

func RemoveBillableMember(ctx context.Context, client *gitlabclient.Client, input RemoveBillableMemberInput) error

RemoveBillableMember removes a billable member from a group (Enterprise Premium/Ultimate).

func RemoveMember

func RemoveMember(ctx context.Context, client *gitlabclient.Client, input RemoveInput) error

RemoveMember removes a member from a group.

func UnshareGroup

func UnshareGroup(ctx context.Context, client *gitlabclient.Client, input UnshareInput) error

UnshareGroup removes a group share.

Types

type AccessLevelDetailsOutput added in v2.3.0

type AccessLevelDetailsOutput struct {
	IntegerValue int    `json:"integer_value"`
	StringValue  string `json:"string_value"`
}

AccessLevelDetailsOutput mirrors gl.AccessLevelDetails (the access_level object on a billable membership).

type AddInput

type AddInput struct {
	GroupID      toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
	UserID       int64                `json:"user_id,omitempty" jsonschema:"User ID to add,required"`
	Username     string               `json:"username,omitempty" jsonschema:"Username to add (alternative to user_id)"`
	AccessLevel  int                  `` /* 223-byte string literal not displayed */
	ExpiresAt    string               `json:"expires_at,omitempty" jsonschema:"Membership expiration date (YYYY-MM-DD)"`
	MemberRoleID int64                `` /* 149-byte string literal not displayed */
}

AddInput contains parameters for adding a group member.

type BillableMemberOutput added in v2.3.0

type BillableMemberOutput struct {
	ID             int64  `json:"id"`
	Username       string `json:"username"`
	Name           string `json:"name"`
	State          string `json:"state"`
	AvatarURL      string `json:"avatar_url,omitempty"`
	WebURL         string `json:"web_url"`
	Email          string `json:"email,omitempty"`
	LastActivityOn string `json:"last_activity_on,omitempty"`
	MembershipType string `json:"membership_type,omitempty"`
	Removable      bool   `json:"removable"`
	CreatedAt      string `json:"created_at,omitempty"`
	IsLastOwner    bool   `json:"is_last_owner"`
	LastLoginAt    string `json:"last_login_at,omitempty"`
}

BillableMemberOutput mirrors gl.BillableGroupMember 1:1 (Enterprise Premium/Ultimate). A billable member is a user who counts toward the group's seat usage, including members inherited from subgroups and shared projects.

type BillableMembersOutput added in v2.3.0

type BillableMembersOutput struct {
	toolutil.HintableOutput
	Members    []BillableMemberOutput    `json:"members"`
	Pagination toolutil.PaginationOutput `json:"pagination"`
}

BillableMembersOutput holds a paginated list of billable group members.

func ListBillableMembers added in v2.3.0

func ListBillableMembers(ctx context.Context, client *gitlabclient.Client, input ListBillableMembersInput) (BillableMembersOutput, error)

ListBillableMembers lists the billable members of a group (Enterprise Premium/Ultimate). The list includes members inherited from subgroups and shared projects.

type BillableMembershipOutput added in v2.3.0

type BillableMembershipOutput struct {
	ID               int64                     `json:"id"`
	SourceID         int64                     `json:"source_id"`
	SourceFullName   string                    `json:"source_full_name"`
	SourceMembersURL string                    `json:"source_members_url,omitempty"`
	CreatedAt        string                    `json:"created_at,omitempty"`
	ExpiresAt        string                    `json:"expires_at,omitempty"`
	AccessLevel      *AccessLevelDetailsOutput `json:"access_level,omitempty"`
}

BillableMembershipOutput mirrors gl.BillableUserMembership 1:1: one of the group/project memberships through which a billable member counts toward the group's seat usage. The access_level sub-object surfaces both the numeric and string forms of the role.

type BillableMembershipsOutput added in v2.3.0

type BillableMembershipsOutput struct {
	toolutil.HintableOutput
	Memberships []BillableMembershipOutput `json:"memberships"`
	Pagination  toolutil.PaginationOutput  `json:"pagination"`
}

BillableMembershipsOutput holds a paginated list of a billable member's memberships.

func ListBillableMemberMemberships added in v2.3.0

func ListBillableMemberMemberships(ctx context.Context, client *gitlabclient.Client, input ListBillableMemberMembershipsInput) (BillableMembershipsOutput, error)

ListBillableMemberMemberships lists the memberships of a single billable member of a group (Enterprise Premium/Ultimate).

type EditInput

type EditInput struct {
	GroupID      toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
	UserID       int64                `json:"user_id" jsonschema:"User ID,required"`
	AccessLevel  int                  `` /* 219-byte string literal not displayed */
	ExpiresAt    string               `json:"expires_at,omitempty" jsonschema:"New membership expiration date (YYYY-MM-DD)"`
	MemberRoleID int64                `` /* 149-byte string literal not displayed */
}

EditInput contains parameters for editing a group member.

type GetInput

type GetInput struct {
	GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
	UserID  int64                `json:"user_id" jsonschema:"User ID,required"`
}

GetInput contains parameters for getting a group member.

type ListBillableMemberMembershipsInput added in v2.3.0

type ListBillableMemberMembershipsInput struct {
	GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
	UserID  int64                `json:"user_id" jsonschema:"User ID of the billable member,required"`
	OrderBy string               `json:"order_by,omitempty" jsonschema:"Column to order memberships by (e.g. id, name)"`
	Sort    string               `json:"sort,omitempty" jsonschema:"Sort direction: asc or desc"`
	toolutil.PaginationInput
	toolutil.KeysetPaginationInput
}

ListBillableMemberMembershipsInput contains parameters for listing the memberships of a single billable group member (Enterprise Premium/Ultimate).

type ListBillableMembersInput added in v2.3.0

type ListBillableMembersInput struct {
	GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
	Search  string               `json:"search,omitempty" jsonschema:"Filter billable members by name or username"`
	OrderBy string               `json:"order_by,omitempty" jsonschema:"Column to order billable members by (e.g. id, name, username, last_activity_on)"`
	Sort    string               `json:"sort,omitempty" jsonschema:"Sort order (e.g. name_asc, name_desc, last_activity_on_asc, last_activity_on_desc)"`
	toolutil.PaginationInput
	toolutil.KeysetPaginationInput
}

ListBillableMembersInput contains parameters for listing billable group members (Enterprise Premium/Ultimate).

type MemberRoleOutput added in v2.3.0

type MemberRoleOutput struct {
	ID                         int64  `json:"id"`
	Name                       string `json:"name"`
	Description                string `json:"description,omitempty"`
	GroupID                    int64  `json:"group_id"`
	BaseAccessLevel            int    `json:"base_access_level"`
	AdminCICDVariables         bool   `json:"admin_cicd_variables,omitempty"`
	AdminComplianceFramework   bool   `json:"admin_compliance_framework,omitempty"`
	AdminGroupMembers          bool   `json:"admin_group_member,omitempty"`
	AdminMergeRequests         bool   `json:"admin_merge_request,omitempty"`
	AdminPushRules             bool   `json:"admin_push_rules,omitempty"`
	AdminTerraformState        bool   `json:"admin_terraform_state,omitempty"`
	AdminVulnerability         bool   `json:"admin_vulnerability,omitempty"`
	AdminWebHook               bool   `json:"admin_web_hook,omitempty"`
	ArchiveProject             bool   `json:"archive_project,omitempty"`
	ManageDeployTokens         bool   `json:"manage_deploy_tokens,omitempty"`
	ManageGroupAccessTokens    bool   `json:"manage_group_access_tokens,omitempty"`
	ManageMergeRequestSettings bool   `json:"manage_merge_request_settings,omitempty"`
	ManageProjectAccessTokens  bool   `json:"manage_project_access_tokens,omitempty"`
	ManageSecurityPolicyLink   bool   `json:"manage_security_policy_link,omitempty"`
	ReadCode                   bool   `json:"read_code,omitempty"`
	ReadRunners                bool   `json:"read_runners,omitempty"`
	ReadDependency             bool   `json:"read_dependency,omitempty"`
	ReadVulnerability          bool   `json:"read_vulnerability,omitempty"`
	RemoveGroup                bool   `json:"remove_group,omitempty"`
	RemoveProject              bool   `json:"remove_project,omitempty"`
}

MemberRoleOutput mirrors gl.MemberRole (the member_role object). Custom member roles are an Enterprise (Premium/Ultimate) feature; the object is nil on instances or members without a custom role.

type MemberUserOutput added in v2.3.0

type MemberUserOutput struct {
	ID        int64  `json:"id"`
	Username  string `json:"username"`
	Name      string `json:"name"`
	State     string `json:"state"`
	AvatarURL string `json:"avatar_url,omitempty"`
	WebURL    string `json:"web_url,omitempty"`
}

MemberUserOutput mirrors gl.MemberCreatedBy (the created_by object).

type Output

type Output struct {
	toolutil.HintableOutput
	ID                int64               `json:"id"`
	Username          string              `json:"username"`
	Name              string              `json:"name"`
	State             string              `json:"state"`
	AvatarURL         string              `json:"avatar_url,omitempty"`
	WebURL            string              `json:"web_url"`
	AccessLevel       int                 `json:"access_level"`
	CreatedAt         string              `json:"created_at,omitempty"`
	CreatedBy         *MemberUserOutput   `json:"created_by,omitempty"`
	ExpiresAt         string              `json:"expires_at,omitempty"`
	Email             string              `json:"email,omitempty"`
	PublicEmail       string              `json:"public_email,omitempty"`
	GroupSAMLIdentity *SAMLIdentityOutput `json:"group_saml_identity,omitempty" tier:"premium"`
	MemberRole        *MemberRoleOutput   `json:"member_role,omitempty" tier:"ultimate"`
	IsUsingSeat       bool                `json:"is_using_seat,omitempty"`
}

Output represents a single group member.

Fields mirror gl.GroupMember (1:1 audit policy: full nested objects). The created_by, group_saml_identity, and member_role sub-objects are surfaced as full local mirrors on their canonical json keys (C-IMPORTS: replicated here rather than imported from sibling packages to preserve the zero-import-cycle constraint).

func AddMember

func AddMember(ctx context.Context, client *gitlabclient.Client, input AddInput) (Output, error)

AddMember adds a member to a group.

func EditMember

func EditMember(ctx context.Context, client *gitlabclient.Client, input EditInput) (Output, error)

EditMember edits a group member.

func GetInheritedMember

func GetInheritedMember(ctx context.Context, client *gitlabclient.Client, input GetInput) (Output, error)

GetInheritedMember gets a single inherited group member.

func GetMember

func GetMember(ctx context.Context, client *gitlabclient.Client, input GetInput) (Output, error)

GetMember gets a single group member.

type RemoveBillableMemberInput added in v2.3.0

type RemoveBillableMemberInput struct {
	GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
	UserID  int64                `json:"user_id" jsonschema:"User ID of the billable member to remove,required"`
}

RemoveBillableMemberInput contains parameters for removing a billable member from a group (Enterprise Premium/Ultimate).

type RemoveInput

type RemoveInput struct {
	GroupID           toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
	UserID            int64                `json:"user_id" jsonschema:"User ID to remove,required"`
	SkipSubresources  bool                 `json:"skip_subresources,omitempty" jsonschema:"Skip removal from subresources"`
	UnassignIssuables bool                 `json:"unassign_issuables,omitempty" jsonschema:"Unassign issues and merge requests"`
}

RemoveInput contains parameters for removing a group member.

type SAMLIdentityOutput added in v2.3.0

type SAMLIdentityOutput struct {
	ExternUID      string `json:"extern_uid"`
	Provider       string `json:"provider"`
	SAMLProviderID int64  `json:"saml_provider_id"`
}

SAMLIdentityOutput mirrors gl.GroupMemberSAMLIdentity (the group_saml_identity object).

type ShareInput

type ShareInput struct {
	GroupID      toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path to share,required"`
	ShareGroupID int64                `json:"share_group_id" jsonschema:"Group ID to share with,required"`
	GroupAccess  int                  `` /* 211-byte string literal not displayed */
	ExpiresAt    string               `json:"expires_at,omitempty" jsonschema:"Share expiration date (YYYY-MM-DD)"`
}

ShareInput contains parameters for sharing a group with another group.

type ShareOutput

type ShareOutput struct {
	toolutil.HintableOutput
	ID          int64  `json:"id"`
	Name        string `json:"name"`
	Path        string `json:"path"`
	Description string `json:"description,omitempty"`
	WebURL      string `json:"web_url"`
}

ShareOutput represents the result of sharing with a group.

func ShareGroup

func ShareGroup(ctx context.Context, client *gitlabclient.Client, input ShareInput) (ShareOutput, error)

ShareGroup shares a group with another group.

type UnshareInput

type UnshareInput struct {
	GroupID      toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
	ShareGroupID int64                `json:"share_group_id" jsonschema:"Group ID to stop sharing with,required"`
}

UnshareInput contains parameters for unsharing a group.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL