Skip to content

feat: add emoji reaction tools for MRs, issues and comments#412

Open
Killusions wants to merge 1 commit intozereight:mainfrom
Killusions:feat/add-emoji-reaction-tools-for-mrs,-issues-and-comments
Open

feat: add emoji reaction tools for MRs, issues and comments#412
Killusions wants to merge 1 commit intozereight:mainfrom
Killusions:feat/add-emoji-reaction-tools-for-mrs,-issues-and-comments

Conversation

@Killusions
Copy link
Copy Markdown
Contributor

@Killusions Killusions commented Apr 12, 2026

Allow Agents to react to show approval, disapproval, pending review, and receive feedback, tested locally.

@Killusions Killusions force-pushed the feat/add-emoji-reaction-tools-for-mrs,-issues-and-comments branch from 2b9717d to db6eb60 Compare April 12, 2026 19:00
@Killusions
Copy link
Copy Markdown
Contributor Author

Forgot to add tools for listing reactions, added.

@Killusions
Copy link
Copy Markdown
Contributor Author

@zereight What do you think of this?

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds first-class emoji reaction tooling to the GitLab MCP server so agents can add/list/remove reactions on merge requests, issues, and work items (including comment/note reactions), aligning with the existing toolset + schema-driven approach.

Changes:

  • Introduces Zod schemas for emoji reaction operations across REST (MRs/issues) and GraphQL (work items).
  • Registers new emoji reaction tools in the tool registry/toolsets and marks delete variants as destructive.
  • Implements REST + GraphQL handlers in index.ts and updates tests/tool counts + schema test coverage.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tools/registry.ts Registers emoji reaction tools, adds them to toolsets, and flags delete variants as destructive.
index.ts Implements REST/GraphQL helpers and handleToolCall cases for emoji reaction list/create/delete.
schemas.ts Adds Zod schemas for MR/issue (REST) and work item (GraphQL) emoji reactions.
test/test-toolset-filtering.ts Updates expected tool counts and extends the issues toolset filtering assertions.
test/test-token-optimizations.ts Extends the issues tool list used in policy edge-case testing.
test/schema-tests.ts Adds schema-level validation tests for the new emoji reaction schemas.

Comment thread test/schema-tests.ts
#!/usr/bin/env ts-node

import { GetFileContentsSchema, GitLabFileContentSchema, CreatePipelineSchema, CreateIssueNoteSchema } from '../schemas.js';
import { GetFileContentsSchema, GitLabFileContentSchema, CreatePipelineSchema, CreateIssueNoteSchema, CreateMergeRequestEmojiReactionSchema, CreateIssueEmojiReactionSchema, DeleteMergeRequestEmojiReactionSchema, DeleteIssueEmojiReactionSchema, CreateMergeRequestNoteEmojiReactionSchema, DeleteMergeRequestNoteEmojiReactionSchema, CreateIssueNoteEmojiReactionSchema, DeleteIssueNoteEmojiReactionSchema, CreateWorkItemEmojiReactionSchema, DeleteWorkItemEmojiReactionSchema, CreateWorkItemNoteEmojiReactionSchema, DeleteWorkItemNoteEmojiReactionSchema } from '../schemas.js';
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The updated import list is now large enough that it hurts readability and is likely to exceed the repo’s configured Prettier printWidth (100). Please reformat this import into a multi-line import (or group imports) so it stays readable and consistent with formatting checks.

Suggested change
import { GetFileContentsSchema, GitLabFileContentSchema, CreatePipelineSchema, CreateIssueNoteSchema, CreateMergeRequestEmojiReactionSchema, CreateIssueEmojiReactionSchema, DeleteMergeRequestEmojiReactionSchema, DeleteIssueEmojiReactionSchema, CreateMergeRequestNoteEmojiReactionSchema, DeleteMergeRequestNoteEmojiReactionSchema, CreateIssueNoteEmojiReactionSchema, DeleteIssueNoteEmojiReactionSchema, CreateWorkItemEmojiReactionSchema, DeleteWorkItemEmojiReactionSchema, CreateWorkItemNoteEmojiReactionSchema, DeleteWorkItemNoteEmojiReactionSchema } from '../schemas.js';
import {
GetFileContentsSchema,
GitLabFileContentSchema,
CreatePipelineSchema,
CreateIssueNoteSchema,
CreateMergeRequestEmojiReactionSchema,
CreateIssueEmojiReactionSchema,
DeleteMergeRequestEmojiReactionSchema,
DeleteIssueEmojiReactionSchema,
CreateMergeRequestNoteEmojiReactionSchema,
DeleteMergeRequestNoteEmojiReactionSchema,
CreateIssueNoteEmojiReactionSchema,
DeleteIssueNoteEmojiReactionSchema,
CreateWorkItemEmojiReactionSchema,
DeleteWorkItemEmojiReactionSchema,
CreateWorkItemNoteEmojiReactionSchema,
DeleteWorkItemNoteEmojiReactionSchema
} from '../schemas.js';

Copilot uses AI. Check for mistakes.
Comment thread index.ts
Comment on lines +3899 to +3906
let path = `${getEffectiveApiUrl()}/projects/${pp}/${entity}/${entityIid}`;
if (opts?.noteId) {
path = opts.discussionId
? `${path}/discussions/${opts.discussionId}/notes/${opts.noteId}`
: `${path}/notes/${opts.noteId}`;
}
path += "/award_emoji";
if (opts?.awardId) path += `/${opts.awardId}`;
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

buildAwardEmojiPath uses if (opts?.noteId) / if (opts?.awardId) but then dereferences opts.discussionId, opts.noteId, and opts.awardId. With strict: true, the optional-chaining checks do not narrow opts, so this should fail TypeScript compilation (opts possibly undefined). Use an explicit if (opts && opts.noteId) / if (opts && opts.awardId) guard, or destructure from opts ?? {} before building the path.

Suggested change
let path = `${getEffectiveApiUrl()}/projects/${pp}/${entity}/${entityIid}`;
if (opts?.noteId) {
path = opts.discussionId
? `${path}/discussions/${opts.discussionId}/notes/${opts.noteId}`
: `${path}/notes/${opts.noteId}`;
}
path += "/award_emoji";
if (opts?.awardId) path += `/${opts.awardId}`;
const { noteId, discussionId, awardId } = opts ?? {};
let path = `${getEffectiveApiUrl()}/projects/${pp}/${entity}/${entityIid}`;
if (noteId) {
path = discussionId
? `${path}/discussions/${discussionId}/notes/${noteId}`
: `${path}/notes/${noteId}`;
}
path += "/award_emoji";
if (awardId) path += `/${awardId}`;

Copilot uses AI. Check for mistakes.
Comment thread tools/registry.ts
Comment on lines +1239 to +1243
"list_issue_emoji_reactions",
"list_issue_note_emoji_reactions",
"create_issue_emoji_reaction",
"delete_issue_emoji_reaction",
"create_issue_note_emoji_reaction",
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The newly added list_*_emoji_reactions tools are read-only (GET) but they are not included in the readOnlyTools allowlist. In GITLAB_READ_ONLY_MODE=true, these list tools will be filtered out even though they should be safe to keep. Add the new list emoji-reaction tools (MR/issue/work item, including note variants) to readOnlyTools and adjust the read-only-mode tests accordingly.

Copilot uses AI. Check for mistakes.
Comment on lines 392 to +396
"create_note",
"list_issue_emoji_reactions",
"list_issue_note_emoji_reactions",
"create_issue_emoji_reaction",
"delete_issue_emoji_reaction",
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the read-only mode test, writeIssueTools includes list_issue_emoji_reactions and list_issue_note_emoji_reactions. These are GET/list operations and should be treated as read-only tools (i.e., expected to be present in read-only mode once the readOnlyTools allowlist is updated). Move the list_* emoji-reaction tools into readOnlyIssueTools and keep only the create/delete variants in writeIssueTools.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants