mirror of
https://gitea.com/gitea/gitea-mcp.git
synced 2025-08-23 22:33:05 +00:00
Update
This commit is contained in:
@@ -6,7 +6,9 @@ import (
|
||||
|
||||
"gitea.com/gitea/gitea-mcp/pkg/gitea"
|
||||
"gitea.com/gitea/gitea-mcp/pkg/to"
|
||||
|
||||
"github.com/mark3labs/mcp-go/mcp"
|
||||
"github.com/mark3labs/mcp-go/server"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -25,20 +27,27 @@ var (
|
||||
"owner",
|
||||
mcp.Required(),
|
||||
mcp.Description("repository owner"),
|
||||
mcp.DefaultString(""),
|
||||
),
|
||||
mcp.WithString(
|
||||
"repo",
|
||||
mcp.Required(),
|
||||
mcp.Description("repository name"),
|
||||
mcp.DefaultString(""),
|
||||
),
|
||||
mcp.WithNumber(
|
||||
"index",
|
||||
mcp.Required(),
|
||||
mcp.Description("repository issue index"),
|
||||
mcp.DefaultNumber(0),
|
||||
),
|
||||
}
|
||||
)
|
||||
|
||||
func RegisterTool(s *server.MCPServer) {
|
||||
s.AddTool(GetIssueByIndexTool, GetIssueByIndexFn)
|
||||
}
|
||||
|
||||
func GetIssueByIndexFn(ctx context.Context, req mcp.CallToolRequest) (*mcp.CallToolResult, error) {
|
||||
owner := req.Params.Arguments["owner"].(string)
|
||||
repo := req.Params.Arguments["repo"].(string)
|
||||
|
Reference in New Issue
Block a user