label

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ListRepoLabelsToolName     = "list_repo_labels"
	GetRepoLabelToolName       = "get_repo_label"
	CreateRepoLabelToolName    = "create_repo_label"
	EditRepoLabelToolName      = "edit_repo_label"
	DeleteRepoLabelToolName    = "delete_repo_label"
	AddIssueLabelsToolName     = "add_issue_labels"
	ReplaceIssueLabelsToolName = "replace_issue_labels"
	ClearIssueLabelsToolName   = "clear_issue_labels"
	RemoveIssueLabelToolName   = "remove_issue_label"
)

Variables

View Source
var (
	ListRepoLabelsTool = mcp.NewTool(
		ListRepoLabelsToolName,
		mcp.WithDescription("Lists all labels for a given repository"),
		mcp.WithString("owner", mcp.Required(), mcp.Description("repository owner")),
		mcp.WithString("repo", mcp.Required(), mcp.Description("repository name")),
		mcp.WithNumber("page", mcp.Description("page number"), mcp.DefaultNumber(1)),
		mcp.WithNumber("pageSize", mcp.Description("page size"), mcp.DefaultNumber(100)),
	)

	GetRepoLabelTool = mcp.NewTool(
		GetRepoLabelToolName,
		mcp.WithDescription("Gets a single label by its ID for a repository"),
		mcp.WithString("owner", mcp.Required(), mcp.Description("repository owner")),
		mcp.WithString("repo", mcp.Required(), mcp.Description("repository name")),
		mcp.WithNumber("id", mcp.Required(), mcp.Description("label ID")),
	)

	CreateRepoLabelTool = mcp.NewTool(
		CreateRepoLabelToolName,
		mcp.WithDescription("Creates a new label for a repository"),
		mcp.WithString("owner", mcp.Required(), mcp.Description("repository owner")),
		mcp.WithString("repo", mcp.Required(), mcp.Description("repository name")),
		mcp.WithString("name", mcp.Required(), mcp.Description("label name")),
		mcp.WithString("color", mcp.Required(), mcp.Description("label color (hex code, e.g., #RRGGBB)")),
		mcp.WithString("description", mcp.Description("label description")),
	)

	EditRepoLabelTool = mcp.NewTool(
		EditRepoLabelToolName,
		mcp.WithDescription("Edits an existing label in a repository"),
		mcp.WithString("owner", mcp.Required(), mcp.Description("repository owner")),
		mcp.WithString("repo", mcp.Required(), mcp.Description("repository name")),
		mcp.WithNumber("id", mcp.Required(), mcp.Description("label ID")),
		mcp.WithString("name", mcp.Description("new label name")),
		mcp.WithString("color", mcp.Description("new label color (hex code, e.g., #RRGGBB)")),
		mcp.WithString("description", mcp.Description("new label description")),
	)

	DeleteRepoLabelTool = mcp.NewTool(
		DeleteRepoLabelToolName,
		mcp.WithDescription("Deletes a label from a repository"),
		mcp.WithString("owner", mcp.Required(), mcp.Description("repository owner")),
		mcp.WithString("repo", mcp.Required(), mcp.Description("repository name")),
		mcp.WithNumber("id", mcp.Required(), mcp.Description("label ID")),
	)

	AddIssueLabelsTool = mcp.NewTool(
		AddIssueLabelsToolName,
		mcp.WithDescription("Adds one or more labels to an issue"),
		mcp.WithString("owner", mcp.Required(), mcp.Description("repository owner")),
		mcp.WithString("repo", mcp.Required(), mcp.Description("repository name")),
		mcp.WithNumber("index", mcp.Required(), mcp.Description("issue index")),
		mcp.WithArray("labels", mcp.Required(), mcp.Description("array of label IDs to add"), mcp.Items(map[string]interface{}{"type": "number"})),
	)

	ReplaceIssueLabelsTool = mcp.NewTool(
		ReplaceIssueLabelsToolName,
		mcp.WithDescription("Replaces all labels on an issue"),
		mcp.WithString("owner", mcp.Required(), mcp.Description("repository owner")),
		mcp.WithString("repo", mcp.Required(), mcp.Description("repository name")),
		mcp.WithNumber("index", mcp.Required(), mcp.Description("issue index")),
		mcp.WithArray("labels", mcp.Required(), mcp.Description("array of label IDs to replace with"), mcp.Items(map[string]interface{}{"type": "number"})),
	)

	ClearIssueLabelsTool = mcp.NewTool(
		ClearIssueLabelsToolName,
		mcp.WithDescription("Removes all labels from an issue"),
		mcp.WithString("owner", mcp.Required(), mcp.Description("repository owner")),
		mcp.WithString("repo", mcp.Required(), mcp.Description("repository name")),
		mcp.WithNumber("index", mcp.Required(), mcp.Description("issue index")),
	)

	RemoveIssueLabelTool = mcp.NewTool(
		RemoveIssueLabelToolName,
		mcp.WithDescription("Removes a single label from an issue"),
		mcp.WithString("owner", mcp.Required(), mcp.Description("repository owner")),
		mcp.WithString("repo", mcp.Required(), mcp.Description("repository name")),
		mcp.WithNumber("index", mcp.Required(), mcp.Description("issue index")),
		mcp.WithNumber("label_id", mcp.Required(), mcp.Description("label ID to remove")),
	)
)
View Source
var Tool = tool.New()

Functions

func AddIssueLabelsFn

func AddIssueLabelsFn(ctx context.Context, req mcp.CallToolRequest) (*mcp.CallToolResult, error)

func ClearIssueLabelsFn

func ClearIssueLabelsFn(ctx context.Context, req mcp.CallToolRequest) (*mcp.CallToolResult, error)

func CreateRepoLabelFn

func CreateRepoLabelFn(ctx context.Context, req mcp.CallToolRequest) (*mcp.CallToolResult, error)

func DeleteRepoLabelFn

func DeleteRepoLabelFn(ctx context.Context, req mcp.CallToolRequest) (*mcp.CallToolResult, error)

func EditRepoLabelFn

func EditRepoLabelFn(ctx context.Context, req mcp.CallToolRequest) (*mcp.CallToolResult, error)

func GetRepoLabelFn

func GetRepoLabelFn(ctx context.Context, req mcp.CallToolRequest) (*mcp.CallToolResult, error)

func ListRepoLabelsFn

func ListRepoLabelsFn(ctx context.Context, req mcp.CallToolRequest) (*mcp.CallToolResult, error)

func RemoveIssueLabelFn

func RemoveIssueLabelFn(ctx context.Context, req mcp.CallToolRequest) (*mcp.CallToolResult, error)

func ReplaceIssueLabelsFn

func ReplaceIssueLabelsFn(ctx context.Context, req mcp.CallToolRequest) (*mcp.CallToolResult, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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