groupimportexport

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: 10 Imported by: 0

Documentation

Overview

Package groupimportexport implements MCP tool handlers for the GitLab Group Import/Export API. It wraps the GroupImportExportService from client-go v2 to schedule group exports, download export archives, and import groups from file archives.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatExportDownloadMarkdown

func FormatExportDownloadMarkdown(out ExportDownloadOutput) *mcp.CallToolResult

FormatExportDownloadMarkdown formats the download result.

func FormatImportFileMarkdown

func FormatImportFileMarkdown(out ImportFileOutput) *mcp.CallToolResult

FormatImportFileMarkdown formats the import result.

func FormatMarkdown

func FormatMarkdown(result any) *mcp.CallToolResult

FormatMarkdown dispatches markdown formatting for group import/export results.

func FormatScheduleExportMarkdown

func FormatScheduleExportMarkdown(out ScheduleExportOutput) *mcp.CallToolResult

FormatScheduleExportMarkdown formats the schedule export result.

func RegisterMeta

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

RegisterMeta registers the gitlab_group_import_export meta-tool.

func RegisterTools

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

RegisterTools registers all group import/export tools on the MCP server.

func ValidActions

func ValidActions() string

ValidActions returns description of available meta-tool actions.

Types

type ExportDownloadInput

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

ExportDownloadInput is the input for downloading a group export.

type ExportDownloadOutput

type ExportDownloadOutput struct {
	toolutil.HintableOutput
	ContentBase64 string `json:"content_base64"`
	SizeBytes     int    `json:"size_bytes"`
}

ExportDownloadOutput is the output for downloading a group export.

func ExportDownload

func ExportDownload(ctx context.Context, client *gitlabclient.Client, input ExportDownloadInput) (ExportDownloadOutput, error)

ExportDownload downloads the finished export archive of a group as base64.

type ImportFileInput

type ImportFileInput struct {
	Name     string `json:"name" jsonschema:"Name for the imported group,required"`
	Path     string `json:"path" jsonschema:"URL path for the imported group,required"`
	File     string `json:"file" jsonschema:"Absolute path to a local export archive (.tar.gz) on the MCP server filesystem,required"`
	ParentID *int64 `json:"parent_id,omitempty" jsonschema:"ID of the parent group to import into"`
}

ImportFileInput is the input for importing a group from an archive file.

type ImportFileOutput

type ImportFileOutput struct {
	toolutil.HintableOutput
	Message string `json:"message"`
}

ImportFileOutput is the output for importing a group.

func ImportFile

func ImportFile(ctx context.Context, client *gitlabclient.Client, input ImportFileInput) (ImportFileOutput, error)

ImportFile imports a group from an export archive.

type ScheduleExportInput

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

ScheduleExportInput is the input for scheduling a group export.

type ScheduleExportOutput

type ScheduleExportOutput struct {
	toolutil.HintableOutput
	Message string `json:"message"`
}

ScheduleExportOutput is the output for scheduling a group export.

func ScheduleExport

func ScheduleExport(ctx context.Context, client *gitlabclient.Client, input ScheduleExportInput) (ScheduleExportOutput, error)

ScheduleExport schedules an asynchronous group export.

Jump to

Keyboard shortcuts

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