Skip to main content
Glama

jira_add_comment

Add comments to Jira issues with optional visibility controls for groups or roles. Enables team collaboration by documenting progress, updates, and discussions directly within issue tracking.

Instructions

Adds a comment to an issue. Supports visibility restrictions for groups or roles. Returns the created comment with author details and timestamp.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bodyYesComment body text
issueKeyYesIssue key to add comment to (e.g., PROJECT-123)
visibilityNoComment visibility restrictions (optional)

Implementation Reference

  • The main handler function that validates input, calls the Jira API to add a comment, formats the response, and handles errors.
    export async function handleAddComment(input: unknown): Promise<McpToolResponse> { try { const validated = validateInput(AddCommentInputSchema, input); log.info(`Adding comment to issue ${validated.issueKey}...`); const comment = await addComment( validated.issueKey, validated.body, validated.visibility, validated.format ); log.info(`Added comment to ${validated.issueKey}`); return formatCommentResponse(comment); } catch (error) { log.error('Error in handleAddComment:', error); return handleError(error); } }
  • Zod schema defining and validating the input parameters for the jira_add_comment tool: issueKey, body, optional visibility and format.
    export const AddCommentInputSchema = z.object({ issueKey: z .string() .describe('Issue key to add comment to') .refine((v) => isValidIssueKey(v), 'Invalid issue key format'), body: z.string().min(1).describe('Comment body text'), visibility: z .object({ type: z.enum(['group', 'role']).describe('Visibility type'), value: z.string().describe('Group name or role name'), }) .optional() .describe('Comment visibility restrictions'), format: z .enum(['markdown', 'adf', 'plain']) .optional() .default('markdown') .describe( 'Comment format: "markdown" (converts Markdown to ADF), "adf" (use as-is ADF object), "plain" (converts plain text to ADF with basic formatting). Default: "markdown"' ), }); export type AddCommentInput = z.infer<typeof AddCommentInputSchema>;
  • src/index.ts:43-43 (registration)
    Registers the 'jira_add_comment' tool name with its handler function in the central toolHandlers Map used by the MCP server.
    [TOOL_NAMES.ADD_COMMENT, tools.handleAddComment],
  • src/index.ts:63-63 (registration)
    Adds the addCommentTool Tool object (with name, description, schema) to the allTools array returned by listTools.
    tools.addCommentTool,
  • Constant definition for the tool name 'jira_add_comment' used across the codebase for registration and references.
    ADD_COMMENT: 'jira_add_comment',

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/freema/mcp-jira-stdio'

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