issues

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CommentIssueToolName is the name of the tool
	CommentIssueToolName = "comment_issue"
)
View Source
const (
	// CreateIssueToolName is the name of the tool
	CreateIssueToolName = "create_issue"
)
View Source
const (
	// Tool name constants
	GetRepoIssueDetailToolName = "get_repo_issue_detail"
)
View Source
const (
	// ListIssueCommentsToolName is the name of the tool
	ListIssueCommentsToolName = "list_issue_comments"
)
View Source
const (
	ListRepoIssuesToolName = "list_repo_issues"
)
View Source
const (
	UpdateIssueToolName = "update_issue"
)

Variables

View Source
var BasicIssueOptions = []mcp.ToolOption{
	mcp.WithString(
		"title",
		mcp.Description("The title of the issue"),
		mcp.Required(),
	),
	mcp.WithString(
		"body",
		mcp.Description("The description of the issue"),
	),
	mcp.WithString(
		"issue_type",
		mcp.Description("Enterprise custom task type, non-enterprise users must consider it as 'task'"),
	),
	mcp.WithString(
		"assignee",
		mcp.Description("The personal space address of the issue assignee"),
	),
	mcp.WithString(
		"collaborators",
		mcp.Description("The personal space addresses of issue collaborators, separated by commas"),
	),
	mcp.WithString(
		"milestone",
		mcp.Description("The milestone number"),
	),
	mcp.WithString(
		"labels",
		mcp.Description("Comma-separated labels, name requirements are between 2-20 in length and non-special characters. Example: bug,performance"),
	),
	mcp.WithString(
		"program",
		mcp.Description("Project ID"),
	),
	mcp.WithBoolean(
		"security_hole",
		mcp.Description("Set as a private issue (default is false)"),
		mcp.DefaultBool(false),
	),
}
View Source
var BasicOptions = []mcp.ToolOption{
	mcp.WithString(
		"owner",
		mcp.Description("The space address to which the repository belongs (the address path of the enterprise, organization or individual)"),
		mcp.Required(),
	),
	mcp.WithString(
		"repo",
		mcp.Description("The path of the repository"),
		mcp.Required(),
	),
}
View Source
var CommentIssueOptions = []mcp.ToolOption{
	mcp.WithString(
		"number",
		mcp.Description("Issue number (case sensitive, no # prefix needed)"),
		mcp.Required(),
	),
	mcp.WithString(
		"body",
		mcp.Description("The contents of the comment"),
		mcp.Required(),
	),
}

CommentIssueOptions defines the specific options for commenting on an issue

View Source
var CommentIssueTool = func() mcp.Tool {
	options := utils.CombineOptions(
		[]mcp.ToolOption{
			mcp.WithDescription("Create a comment on a repository issue"),
		},
		BasicOptions,
		CommentIssueOptions,
	)
	return mcp.NewTool(CommentIssueToolName, options...)
}()

CommentIssueTool defines the tool for commenting on an issue

View Source
var CreateIssueTool = func() mcp.Tool {
	options := utils.CombineOptions(
		[]mcp.ToolOption{
			mcp.WithDescription("Create an issue"),
		},
		BasicOptions,
		BasicIssueOptions,
	)
	return mcp.NewTool(CreateIssueToolName, options...)
}()
View Source
var ListIssueCommentsOptions = []mcp.ToolOption{
	mcp.WithString(
		"number",
		mcp.Description("Issue number (case sensitive, no # prefix needed)"),
		mcp.Required(),
	),
	mcp.WithString(
		"since",
		mcp.Description("Only comments updated at or after this time are returned. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ"),
	),
	mcp.WithNumber(
		"page",
		mcp.Description("Current page number"),
		mcp.DefaultNumber(1),
	),
	mcp.WithNumber(
		"per_page",
		mcp.Description("Number of results per page, maximum 100"),
		mcp.DefaultNumber(20),
	),
	mcp.WithString(
		"order",
		mcp.Description("Sort direction: asc(default), desc"),
		mcp.DefaultString("asc"),
	),
}

ListIssueCommentsOptions defines the specific options for listing issue comments

View Source
var ListIssueCommentsTool = func() mcp.Tool {
	options := utils.CombineOptions(
		[]mcp.ToolOption{
			mcp.WithDescription("Get all comments for a repository issue"),
		},
		BasicOptions,
		ListIssueCommentsOptions,
	)
	return mcp.NewTool(ListIssueCommentsToolName, options...)
}()

ListIssueCommentsTool defines the tool for listing issue comments

View Source
var UpdateIssueTool = func() mcp.Tool {
	options := utils.CombineOptions(
		[]mcp.ToolOption{
			mcp.WithDescription("Update an issue"),
			mcp.WithString(
				"number",
				mcp.Description("The number of the issue"),
				mcp.Required(),
			),
			mcp.WithString(
				"state",
				mcp.Description("The state of the issue"),
				mcp.Enum("open", "progressing", "closed"),
			),
		},
		BasicOptions,
		BasicIssueOptions,
	)
	return mcp.NewTool(UpdateIssueToolName, options...)
}()

Functions

func CommentIssueHandleFunc

func CommentIssueHandleFunc(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error)

CommentIssueHandleFunc handles the request to comment on an issue

func CreateIssueHandleFunc

func CreateIssueHandleFunc(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error)

func GetIssueDetailHandleFunc

func GetIssueDetailHandleFunc(getType string) server.ToolHandlerFunc

GetIssueDetailHandleFunc handles the request to get issue details

func ListIssueCommentsHandleFunc

func ListIssueCommentsHandleFunc(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error)

ListIssueCommentsHandleFunc handles the request to list issue comments

func ListIssuesHandleFunc

func ListIssuesHandleFunc(listType string) server.ToolHandlerFunc

func NewGetIssueDetailTool

func NewGetIssueDetailTool(getType string) mcp.Tool

NewGetIssueDetailTool creates a tool for getting issue details

func NewListIssuesTool

func NewListIssuesTool(listType string) mcp.Tool

func UpdateIssueHandleFunc

func UpdateIssueHandleFunc(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error)

UpdateIssueHandleFunc handles requests to update repository issues

func UpdateIssueHandleFuncCommon

func UpdateIssueHandleFuncCommon(updateType string) func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error)

UpdateIssueHandleFuncCommon is a common handler function for processing issue update requests

Types

type UpdateIssueConfig

type UpdateIssueConfig struct {
	UrlTemplate string
	PathParams  []string
}

UpdateIssueConfig structure for updating issues

Jump to

Keyboard shortcuts

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