accessrequests

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package accessrequests implements MCP tools for GitLab project and group access request operations using the AccessRequestsService API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DenyGroup

func DenyGroup(ctx context.Context, client *gitlabclient.Client, input DenyGroupInput) error

DenyGroup denies a group access request.

func DenyProject

func DenyProject(ctx context.Context, client *gitlabclient.Client, input DenyProjectInput) error

DenyProject denies a project access request.

func FormatListMarkdown

func FormatListMarkdown(out ListOutput) string

FormatListMarkdown formats a list of access requests as markdown.

func FormatOutputMarkdown

func FormatOutputMarkdown(out Output) string

FormatOutputMarkdown formats a single access request as markdown.

func RegisterMeta

func RegisterMeta(server *mcp.Server, client *gitlabclient.Client)

RegisterMeta registers the gitlab_access_request meta-tool.

func RegisterTools

func RegisterTools(server *mcp.Server, client *gitlabclient.Client)

RegisterTools registers all access request MCP tools.

Types

type ApproveGroupInput

type ApproveGroupInput struct {
	GroupID     toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or path,required"`
	UserID      int64                `json:"user_id" jsonschema:"User ID of the access requester,required"`
	AccessLevel int                  `json:"access_level,omitempty" jsonschema:"Access level to grant (10=Guest, 20=Reporter, 30=Developer, 40=Maintainer)"`
}

ApproveGroupInput represents the input for approving a group access request.

type ApproveProjectInput

type ApproveProjectInput struct {
	ProjectID   toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or path,required"`
	UserID      int64                `json:"user_id" jsonschema:"User ID of the access requester,required"`
	AccessLevel int                  `json:"access_level,omitempty" jsonschema:"Access level to grant (10=Guest, 20=Reporter, 30=Developer, 40=Maintainer)"`
}

ApproveProjectInput represents the input for approving a project access request.

type DenyGroupInput

type DenyGroupInput struct {
	GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or path,required"`
	UserID  int64                `json:"user_id" jsonschema:"User ID of the access requester,required"`
}

DenyGroupInput represents the input for denying a group access request.

type DenyProjectInput

type DenyProjectInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or path,required"`
	UserID    int64                `json:"user_id" jsonschema:"User ID of the access requester,required"`
}

DenyProjectInput represents the input for denying a project access request.

type ListGroupInput

type ListGroupInput struct {
	GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or path,required"`
	Page    int                  `json:"page,omitempty" jsonschema:"Page number for pagination"`
	PerPage int                  `json:"per_page,omitempty" jsonschema:"Number of items per page"`
}

ListGroupInput represents the input for listing group access requests.

type ListOutput

type ListOutput struct {
	toolutil.HintableOutput
	AccessRequests []Output                  `json:"access_requests"`
	Pagination     toolutil.PaginationOutput `json:"pagination"`
}

ListOutput represents a paginated list of access requests.

func ListGroup

func ListGroup(ctx context.Context, client *gitlabclient.Client, input ListGroupInput) (ListOutput, error)

ListGroup lists access requests for a group.

func ListProject

func ListProject(ctx context.Context, client *gitlabclient.Client, input ListProjectInput) (ListOutput, error)

ListProject lists access requests for a project.

type ListProjectInput

type ListProjectInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or path,required"`
	Page      int                  `json:"page,omitempty" jsonschema:"Page number for pagination"`
	PerPage   int                  `json:"per_page,omitempty" jsonschema:"Number of items per page"`
}

ListProjectInput represents the input for listing project access requests.

type Output

type Output struct {
	toolutil.HintableOutput
	ID          int64  `json:"id"`
	Username    string `json:"username"`
	Name        string `json:"name"`
	State       string `json:"state"`
	CreatedAt   string `json:"created_at,omitempty"`
	RequestedAt string `json:"requested_at,omitempty"`
	AccessLevel int    `json:"access_level"`
}

Output represents a single access request.

func ApproveGroup

func ApproveGroup(ctx context.Context, client *gitlabclient.Client, input ApproveGroupInput) (Output, error)

ApproveGroup approves a group access request.

func ApproveProject

func ApproveProject(ctx context.Context, client *gitlabclient.Client, input ApproveProjectInput) (Output, error)

ApproveProject approves a project access request.

func RequestGroup

func RequestGroup(ctx context.Context, client *gitlabclient.Client, input RequestGroupInput) (Output, error)

RequestGroup requests access to a group for the authenticated user.

func RequestProject

func RequestProject(ctx context.Context, client *gitlabclient.Client, input RequestProjectInput) (Output, error)

RequestProject requests access to a project for the authenticated user.

type RequestGroupInput

type RequestGroupInput struct {
	GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or path,required"`
}

RequestGroupInput represents the input for requesting access to a group.

type RequestProjectInput

type RequestProjectInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or path,required"`
}

RequestProjectInput represents the input for requesting access to a project.

Jump to

Keyboard shortcuts

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