27 Star 252 Fork 71

开源中国/mcp-gitee

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
create_issue.go 938 Bytes
一键复制 编辑 原始数据 按行查看 历史
JJ-H 提交于 2025-06-16 16:10 +08:00 . feat: Support streamable http
package issues
import (
"context"
"fmt"
"gitee.com/oschina/mcp-gitee/operations/types"
"gitee.com/oschina/mcp-gitee/utils"
"github.com/mark3labs/mcp-go/mcp"
)
const (
// CreateIssueToolName is the name of the tool
CreateIssueToolName = "create_issue"
)
var CreateIssueTool = func() mcp.Tool {
options := utils.CombineOptions(
[]mcp.ToolOption{
mcp.WithDescription("Create an issue"),
},
BasicOptions,
BasicIssueOptions,
)
return mcp.NewTool(CreateIssueToolName, options...)
}()
func CreateIssueHandleFunc(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) {
args, _ := utils.ConvertArgumentsToMap(request.Params.Arguments)
owner := args["owner"].(string)
apiUrl := fmt.Sprintf("/repos/%s/issues", owner)
giteeClient := utils.NewGiteeClient("POST", apiUrl, utils.WithContext(ctx), utils.WithPayload(args))
issue := &types.BasicIssue{}
return giteeClient.HandleMCPResult(issue)
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/oschina/mcp-gitee.git
git@gitee.com:oschina/mcp-gitee.git
oschina
mcp-gitee
mcp-gitee
master

搜索帮助