Documentation
¶
Overview ¶
Package groupmembers implements MCP tools for GitLab group member operations.
The package wraps the GitLab Members API for group membership:
Index ¶
- func ActionSpecs(client *gitlabclient.Client) []toolutil.ActionSpec
- func FormatBillableMembersMarkdown(out BillableMembersOutput) string
- func FormatBillableMembershipsMarkdown(out BillableMembershipsOutput) string
- func FormatMemberMarkdown(out Output) string
- func FormatShareMarkdown(out ShareOutput) string
- func RemoveBillableMember(ctx context.Context, client *gitlabclient.Client, ...) error
- func RemoveMember(ctx context.Context, client *gitlabclient.Client, input RemoveInput) error
- func UnshareGroup(ctx context.Context, client *gitlabclient.Client, input UnshareInput) error
- type AccessLevelDetailsOutput
- type AddInput
- type BillableMemberOutput
- type BillableMembersOutput
- type BillableMembershipOutput
- type BillableMembershipsOutput
- type EditInput
- type GetInput
- type ListBillableMemberMembershipsInput
- type ListBillableMembersInput
- type MemberRoleOutput
- type MemberUserOutput
- type Output
- func AddMember(ctx context.Context, client *gitlabclient.Client, input AddInput) (Output, error)
- func EditMember(ctx context.Context, client *gitlabclient.Client, input EditInput) (Output, error)
- func GetInheritedMember(ctx context.Context, client *gitlabclient.Client, input GetInput) (Output, error)
- func GetMember(ctx context.Context, client *gitlabclient.Client, input GetInput) (Output, error)
- type RemoveBillableMemberInput
- type RemoveInput
- type SAMLIdentityOutput
- type ShareInput
- type ShareOutput
- type UnshareInput
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 ¶
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 = toolutil.MemberRoleOutput
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. Canonical shape shared via toolutil.
type MemberUserOutput ¶ added in v2.3.0
type MemberUserOutput = toolutil.MemberUserOutput
MemberUserOutput mirrors gl.MemberCreatedBy (the created_by object); canonical shape shared via toolutil.
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 EditMember ¶
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.
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 = toolutil.SAMLIdentityOutput
SAMLIdentityOutput mirrors gl.GroupMemberSAMLIdentity (the group_saml_identity object); canonical shape shared via toolutil.
type ShareInput ¶
type ShareInput struct {
}
ShareInput contains parameters for sharing a group with another group.
type ShareOutput ¶
type ShareOutput struct {
}
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 {
}
UnshareInput contains parameters for unsharing a group.