alertmanagement

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

Documentation

Overview

Package alertmanagement implements MCP tools for GitLab Alert Management metric images.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteMetricImage

func DeleteMetricImage(ctx context.Context, client *gitlabclient.Client, input DeleteMetricImageInput) error

DeleteMetricImage deletes a metric image for an alert.

func FormatImageMarkdown

func FormatImageMarkdown(img MetricImageItem) string

FormatImageMarkdown formats a single metric image as markdown.

func FormatListMarkdown

func FormatListMarkdown(out ListMetricImagesOutput) string

FormatListMarkdown formats metric images as markdown.

func RegisterMeta

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

RegisterMeta registers the gitlab_alert_management meta-tool.

func RegisterTools

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

RegisterTools registers all alert management tools with the MCP server.

Types

type DeleteMetricImageInput

type DeleteMetricImageInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	AlertIID  int64                `json:"alert_iid" jsonschema:"Alert IID,required"`
	ImageID   int64                `json:"image_id" jsonschema:"Metric image ID,required"`
}

DeleteMetricImageInput contains parameters for deleting a metric image.

type ListMetricImagesInput

type ListMetricImagesInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	AlertIID  int64                `json:"alert_iid" jsonschema:"Alert IID,required"`
	Page      int64                `json:"page" jsonschema:"Page number for pagination"`
	PerPage   int64                `json:"per_page" jsonschema:"Number of items per page"`
}

ListMetricImagesInput contains parameters for listing alert metric images.

type ListMetricImagesOutput

type ListMetricImagesOutput struct {
	toolutil.HintableOutput
	Images     []MetricImageItem         `json:"images"`
	Pagination toolutil.PaginationOutput `json:"pagination"`
}

ListMetricImagesOutput contains a list of metric images.

func ListMetricImages

func ListMetricImages(ctx context.Context, client *gitlabclient.Client, input ListMetricImagesInput) (ListMetricImagesOutput, error)

ListMetricImages retrieves metric images for an alert.

type MetricImageItem

type MetricImageItem struct {
	toolutil.HintableOutput
	ID       int64  `json:"id"`
	Filename string `json:"filename"`
	FilePath string `json:"file_path"`
	URL      string `json:"url"`
	URLText  string `json:"url_text"`
}

MetricImageItem represents a single metric image.

func UpdateMetricImage

func UpdateMetricImage(ctx context.Context, client *gitlabclient.Client, input UpdateMetricImageInput) (MetricImageItem, error)

UpdateMetricImage updates a metric image for an alert.

func UploadMetricImage

func UploadMetricImage(ctx context.Context, client *gitlabclient.Client, input UploadMetricImageInput) (MetricImageItem, error)

UploadMetricImage uploads a metric image for an alert.

type UpdateMetricImageInput

type UpdateMetricImageInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	AlertIID  int64                `json:"alert_iid" jsonschema:"Alert IID,required"`
	ImageID   int64                `json:"image_id" jsonschema:"Metric image ID,required"`
	URL       *string              `json:"url" jsonschema:"URL to link the metric image to"`
	URLText   *string              `json:"url_text" jsonschema:"Text for the URL link"`
}

UpdateMetricImageInput contains parameters for updating a metric image.

type UploadMetricImageInput

type UploadMetricImageInput struct {
	ProjectID     toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	AlertIID      int64                `json:"alert_iid" jsonschema:"Alert IID,required"`
	FilePathLocal string               `` /* 196-byte string literal not displayed */
	ContentBase64 string               `` /* 134-byte string literal not displayed */
	Filename      string               `json:"filename" jsonschema:"Image filename,required"`
	URL           *string              `json:"url" jsonschema:"URL to link the metric image to"`
	URLText       *string              `json:"url_text" jsonschema:"Text for the URL link"`
}

UploadMetricImageInput contains parameters for uploading a metric image. Exactly one of FilePath or ContentBase64 must be provided.

Jump to

Keyboard shortcuts

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