Skip to main content
Glama
nulab

Backlog MCP Server

add_issue_comment

Add comments to Backlog issues to provide updates, share information, or collaborate with team members on project tasks.

Instructions

Adds a comment to an issue

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
issueIdNoThe numeric ID of the issue (e.g., 12345)
issueKeyNoThe key of the issue (e.g., 'PROJ-123')
contentYesComment content
notifiedUserIdNoUser IDs to notify
attachmentIdNoAttachment IDs

Implementation Reference

  • The asynchronous handler function that resolves the issue identifier and posts a comment to the issue using the Backlog client, including optional notified users and attachments.
    handler: async ({
      issueId,
      issueKey,
      content,
      notifiedUserId,
      attachmentId,
    }) => {
      const result = resolveIdOrKey('issue', { id: issueId, key: issueKey }, t);
      if (!result.ok) {
        throw result.error;
      }
      return backlog.postIssueComments(result.value, {
        content,
        notifiedUserId,
        attachmentId,
      });
    },
  • Zod schema defining the input parameters for the add_issue_comment tool: optional issue ID or key, required content, optional notified user IDs and attachment IDs.
    const addIssueCommentSchema = buildToolSchema((t) => ({
      issueId: z
        .number()
        .optional()
        .describe(
          t(
            'TOOL_ADD_ISSUE_COMMENT_ID',
            'The numeric ID of the issue (e.g., 12345)'
          )
        ),
      issueKey: z
        .string()
        .optional()
        .describe(
          t('TOOL_ADD_ISSUE_COMMENT_KEY', "The key of the issue (e.g., 'PROJ-123')")
        ),
      content: z
        .string()
        .describe(t('TOOL_ADD_ISSUE_COMMENT_CONTENT', 'Comment content')),
      notifiedUserId: z
        .array(z.number())
        .optional()
        .describe(
          t('TOOL_ADD_ISSUE_COMMENT_NOTIFIED_USER_ID', 'User IDs to notify')
        ),
      attachmentId: z
        .array(z.number())
        .optional()
        .describe(t('TOOL_ADD_ISSUE_COMMENT_ATTACHMENT_ID', 'Attachment IDs')),
    }));
  • Instantiation and registration of the addIssueCommentTool within the 'issue' toolset group in the allTools export.
    addIssueCommentTool(backlog, helper),
  • Tool schema (input wrapped in z.object) and output schema reference.
    schema: z.object(addIssueCommentSchema(t)),
    outputSchema: IssueCommentSchema,
  • Factory function exporting the complete ToolDefinition for 'add_issue_comment', including name, description, schemas, and handler.
    export const addIssueCommentTool = (
      backlog: Backlog,
      { t }: TranslationHelper
    ): ToolDefinition<
      ReturnType<typeof addIssueCommentSchema>,
      (typeof IssueCommentSchema)['shape']
    > => {
      return {
        name: 'add_issue_comment',
        description: t(
          'TOOL_ADD_ISSUE_COMMENT_DESCRIPTION',
          'Adds a comment to an issue'
        ),
        schema: z.object(addIssueCommentSchema(t)),
        outputSchema: IssueCommentSchema,
        handler: async ({
          issueId,
          issueKey,
          content,
          notifiedUserId,
          attachmentId,
        }) => {
          const result = resolveIdOrKey('issue', { id: issueId, key: issueKey }, t);
          if (!result.ok) {
            throw result.error;
          }
          return backlog.postIssueComments(result.value, {
            content,
            notifiedUserId,
            attachmentId,
          });
        },
      };
    };

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nulab/backlog-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server