Documentation
¶
Index ¶
- Constants
- Variables
- func CommentIssueHandleFunc(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error)
- func CreateIssueHandleFunc(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error)
- func GetIssueDetailHandleFunc(getType string) server.ToolHandlerFunc
- func ListIssueCommentsHandleFunc(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error)
- func ListIssuesHandleFunc(listType string) server.ToolHandlerFunc
- func NewGetIssueDetailTool(getType string) mcp.Tool
- func NewListIssuesTool(listType string) mcp.Tool
- func UpdateIssueHandleFunc(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error)
- func UpdateIssueHandleFuncCommon(updateType string) ...
- type UpdateIssueConfig
Constants ¶
const (
// CommentIssueToolName is the name of the tool
CommentIssueToolName = "comment_issue"
)
const (
// CreateIssueToolName is the name of the tool
CreateIssueToolName = "create_issue"
)
const (
// Tool name constants
GetRepoIssueDetailToolName = "get_repo_issue_detail"
)
const (
// ListIssueCommentsToolName is the name of the tool
ListIssueCommentsToolName = "list_issue_comments"
)
const (
ListRepoIssuesToolName = "list_repo_issues"
)
const (
UpdateIssueToolName = "update_issue"
)
Variables ¶
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), ), }
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(), ), }
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
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
var CreateIssueTool = func() mcp.Tool { options := utils.CombineOptions( []mcp.ToolOption{ mcp.WithDescription("Create an issue"), }, BasicOptions, BasicIssueOptions, ) return mcp.NewTool(CreateIssueToolName, options...) }()
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
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
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 ¶
NewGetIssueDetailTool creates a tool for getting issue details
func NewListIssuesTool ¶
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 ¶
UpdateIssueConfig structure for updating issues