Documentation
¶
Overview ¶
Package memberroles implements MCP tools for GitLab member role operations.
The package wraps the GitLab Member roles API:
Index ¶
- func ActionSpecs(client *gitlabclient.Client) []toolutil.ActionSpec
- func DeleteGroup(ctx context.Context, client *gitlabclient.Client, in DeleteGroupInput) error
- func DeleteInstance(ctx context.Context, client *gitlabclient.Client, in DeleteInstanceInput) error
- func FormatListMarkdown(out ListOutput) string
- func FormatOutputMarkdown(o Output) string
- type CreateGroupInput
- type CreateInstanceInput
- type DeleteGroupInput
- type DeleteInstanceInput
- type ListGroupInput
- type ListInstanceInput
- type ListOutput
- type Output
- type Permissions
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 custom member role actions exposed as MCP tools. The instance and group list, create, and delete routes are projected into the dynamic, meta, individual, and audit surfaces by the action catalog (ADR-0004).
func DeleteGroup ¶
func DeleteGroup(ctx context.Context, client *gitlabclient.Client, in DeleteGroupInput) error
DeleteGroup deletes a group-level custom member role via the GitLab Member Roles API (DELETE /groups/:id/member_roles/:member_role_id). Requires Owner role on the group and an Ultimate license.
func DeleteInstance ¶
func DeleteInstance(ctx context.Context, client *gitlabclient.Client, in DeleteInstanceInput) error
DeleteInstance deletes an instance-level custom member role via the GitLab Member Roles API (DELETE /member_roles/:member_role_id). Requires administrator access and self-managed Ultimate.
func FormatListMarkdown ¶
func FormatListMarkdown(out ListOutput) string
FormatListMarkdown renders a list of member roles as Markdown.
func FormatOutputMarkdown ¶
FormatOutputMarkdown renders a single member role as Markdown.
Types ¶
type CreateGroupInput ¶
type CreateGroupInput struct {
GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
Name string `json:"name" jsonschema:"Name of the custom role,required"`
BaseAccessLevel int `` /* 201-byte string literal not displayed */
Description string `json:"description,omitempty" jsonschema:"Description of the custom role"`
Permissions
}
CreateGroupInput holds parameters for creating a group member role.
type CreateInstanceInput ¶
type CreateInstanceInput struct {
Name string `json:"name" jsonschema:"Name of the custom role,required"`
BaseAccessLevel int `` /* 201-byte string literal not displayed */
Description string `json:"description,omitempty" jsonschema:"Description of the custom role"`
Permissions
}
CreateInstanceInput holds parameters for creating an instance member role. It mirrors gl.CreateMemberRoleOptions 1:1 by json/url tag (name, base_access_level, description, plus the permission flags via the embedded Permissions) and is the canonical typed pairing the shared options builder consumes, so the SDK Options literal is attributed here rather than to the permission-only Permissions fragment.
type DeleteGroupInput ¶
type DeleteGroupInput struct {
GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
MemberRoleID int64 `json:"member_role_id" jsonschema:"Member role ID to delete,required"`
}
DeleteGroupInput holds parameters for deleting a group member role.
type DeleteInstanceInput ¶
type DeleteInstanceInput struct {
MemberRoleID int64 `json:"member_role_id" jsonschema:"Member role ID to delete,required"`
}
DeleteInstanceInput holds parameters for deleting an instance member role.
type ListGroupInput ¶
type ListGroupInput struct {
GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
}
ListGroupInput holds parameters for listing group member roles.
type ListInstanceInput ¶
type ListInstanceInput struct{}
ListInstanceInput holds parameters for listing instance member roles.
type ListOutput ¶
type ListOutput struct {
toolutil.HintableOutput
Roles []Output `json:"roles"`
}
ListOutput holds the list response.
func ListGroup ¶
func ListGroup(ctx context.Context, client *gitlabclient.Client, in ListGroupInput) (ListOutput, error)
ListGroup lists every custom member role for a top-level group via the GitLab Member Roles API (GET /groups/:id/member_roles). Requires Owner role on the group and an Ultimate license.
func ListInstance ¶
func ListInstance(ctx context.Context, client *gitlabclient.Client, _ ListInstanceInput) (ListOutput, error)
ListInstance lists every custom member role defined at the GitLab instance level via the GitLab Member Roles API (GET /member_roles). Requires administrator access and is only available on self-managed Ultimate installations.
type Output ¶
type Output struct {
toolutil.HintableOutput
ID int64 `json:"id"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
GroupID int64 `json:"group_id,omitempty"`
BaseAccessLevel int `json:"base_access_level"`
Permissions
}
Output represents a member role.
func CreateGroup ¶
func CreateGroup(ctx context.Context, client *gitlabclient.Client, in CreateGroupInput) (Output, error)
CreateGroup creates a new group-level custom member role via the GitLab Member Roles API (POST /groups/:id/member_roles). Requires Owner role on the group and an Ultimate license.
func CreateInstance ¶
func CreateInstance(ctx context.Context, client *gitlabclient.Client, in CreateInstanceInput) (Output, error)
CreateInstance creates a new instance-level custom member role via the GitLab Member Roles API (POST /member_roles). Requires administrator access and self-managed Ultimate.
type Permissions ¶
type Permissions struct {
AdminCICDVariables *bool `json:"admin_cicd_variables,omitempty" jsonschema:"Allow admin CI/CD variables"`
AdminComplianceFramework *bool `json:"admin_compliance_framework,omitempty" jsonschema:"Allow admin compliance framework"`
AdminGroupMembers *bool `json:"admin_group_member,omitempty" jsonschema:"Allow admin group members"`
AdminMergeRequests *bool `json:"admin_merge_request,omitempty" jsonschema:"Allow admin merge requests"`
AdminPushRules *bool `json:"admin_push_rules,omitempty" jsonschema:"Allow admin push rules"`
AdminTerraformState *bool `json:"admin_terraform_state,omitempty" jsonschema:"Allow admin Terraform state"`
AdminVulnerability *bool `json:"admin_vulnerability,omitempty" jsonschema:"Allow admin vulnerability"`
AdminWebHook *bool `json:"admin_web_hook,omitempty" jsonschema:"Allow admin webhooks"`
ArchiveProject *bool `json:"archive_project,omitempty" jsonschema:"Allow archive project"`
ManageDeployTokens *bool `json:"manage_deploy_tokens,omitempty" jsonschema:"Allow manage deploy tokens"`
ManageGroupAccessTokens *bool `json:"manage_group_access_tokens,omitempty" jsonschema:"Allow manage group access tokens"`
ManageMergeRequestSettings *bool `json:"manage_merge_request_settings,omitempty" jsonschema:"Allow manage MR settings"`
ManageProjectAccessTokens *bool `json:"manage_project_access_tokens,omitempty" jsonschema:"Allow manage project access tokens"`
ManageSecurityPolicyLink *bool `json:"manage_security_policy_link,omitempty" jsonschema:"Allow manage security policy link"`
ReadCode *bool `json:"read_code,omitempty" jsonschema:"Allow read code"`
ReadRunners *bool `json:"read_runners,omitempty" jsonschema:"Allow read runners"`
ReadDependency *bool `json:"read_dependency,omitempty" jsonschema:"Allow read dependency"`
ReadVulnerability *bool `json:"read_vulnerability,omitempty" jsonschema:"Allow read vulnerability"`
RemoveGroup *bool `json:"remove_group,omitempty" jsonschema:"Allow remove group"`
RemoveProject *bool `json:"remove_project,omitempty" jsonschema:"Allow remove project"`
}
Permissions represents the optional permission flags for a custom member role.