MCPcopy Index your code
hub / github.com/github/github-mcp-server / GranularAddIssueCommentReaction

Function GranularAddIssueCommentReaction

pkg/github/issues_granular.go:1285–1364  ·  view source on GitHub ↗

GranularAddIssueCommentReaction adds a reaction to an issue or pull request comment.

(t translations.TranslationHelperFunc)

Source from the content-addressed store, hash-verified

1283
1284// GranularAddIssueCommentReaction adds a reaction to an issue or pull request comment.
1285func GranularAddIssueCommentReaction(t translations.TranslationHelperFunc) inventory.ServerTool {
1286 st := NewTool(
1287 ToolsetMetadataIssues,
1288 mcp.Tool{
1289 Name: "add_issue_comment_reaction",
1290 Description: t("TOOL_ADD_ISSUE_COMMENT_REACTION_DESCRIPTION", "Add a reaction to an issue or pull request comment."),
1291 Annotations: &mcp.ToolAnnotations{
1292 Title: t("TOOL_ADD_ISSUE_COMMENT_REACTION_USER_TITLE", "Add Reaction to Issue or Pull Request Comment"),
1293 ReadOnlyHint: false,
1294 DestructiveHint: jsonschema.Ptr(false),
1295 OpenWorldHint: jsonschema.Ptr(true),
1296 },
1297 InputSchema: &jsonschema.Schema{
1298 Type: "object",
1299 Properties: map[string]*jsonschema.Schema{
1300 "owner": {
1301 Type: "string",
1302 Description: "Repository owner (username or organization)",
1303 },
1304 "repo": {
1305 Type: "string",
1306 Description: "Repository name",
1307 },
1308 "comment_id": {
1309 Type: "number",
1310 Description: "The issue or pull request comment ID",
1311 Minimum: jsonschema.Ptr(1.0),
1312 },
1313 "content": {
1314 Type: "string",
1315 Description: "The emoji reaction type",
1316 Enum: []any{"+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"},
1317 },
1318 },
1319 Required: []string{"owner", "repo", "comment_id", "content"},
1320 },
1321 },
1322 []scopes.Scope{scopes.Repo},
1323 func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args map[string]any) (*mcp.CallToolResult, any, error) {
1324 owner, err := RequiredParam[string](args, "owner")
1325 if err != nil {
1326 return utils.NewToolResultError(err.Error()), nil, nil
1327 }
1328 repo, err := RequiredParam[string](args, "repo")
1329 if err != nil {
1330 return utils.NewToolResultError(err.Error()), nil, nil
1331 }
1332 commentID, err := RequiredBigInt(args, "comment_id")
1333 if err != nil {
1334 return utils.NewToolResultError(err.Error()), nil, nil
1335 }
1336 content, err := RequiredParam[string](args, "content")
1337 if err != nil {
1338 return utils.NewToolResultError(err.Error()), nil, nil
1339 }
1340
1341 client, err := deps.GetClient(ctx)
1342 if err != nil {

Callers 2

AllToolsFunction · 0.85

Calls 8

NewToolResultErrorFunction · 0.92
NewToolResultTextFunction · 0.92
NewToolFunction · 0.85
RequiredBigIntFunction · 0.85
CloseMethod · 0.80
GetClientMethod · 0.65
ErrorMethod · 0.45

Tested by 1