Skip to main content
Glama

add_comment

Add comments to Jira issues to provide updates, share information, or document progress on project tasks and bug reports.

Instructions

Add a comment to a Jira issue

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commentYesThe comment in ADF format or plain string. Example ADF: {"type":"doc","version":1,"content":[{"type":"paragraph","content":[{"type":"text","text":"Comment text"}]}]}
issueKeyYesThe issue key to comment on (e.g., PROJ-123)

Implementation Reference

  • The handler function that implements the core logic for the 'add_comment' tool: validates inputs, converts plain text comments to ADF format, posts to Jira API, and returns success/error responses.
    async handleAddComment(args: any) { try { const { issueKey, comment } = args; if (!issueKey || !comment) { throw new Error('issueKey and comment are required'); } // Handle comment body - convert to ADF format if it's plain text let commentBody; if (typeof comment === 'string') { // Convert plain text to Atlassian Document Format commentBody = { type: 'doc', version: 1, content: [ { type: 'paragraph', content: [ { type: 'text', text: comment, }, ], }, ], }; } else { // Already in ADF format commentBody = comment; } const commentData = { body: commentBody, }; const result = await this.apiClient.post(`/issue/${issueKey}/comment`, commentData); return { content: [ { type: 'text', text: `✅ Comment added to ${issueKey} successfully!\n\n**Comment ID**: ${result.id}`, }, ], }; } catch (error: any) { return { content: [ { type: 'text', text: JiraFormatters.formatError(error), }, ], isError: true, }; } }
  • The tool definition including name, description, and input schema for 'add_comment' used for tool listing and validation.
    { name: 'add_comment', description: 'Add a comment to a Jira issue', inputSchema: { type: 'object', properties: { issueKey: { type: 'string', description: 'The issue key to comment on (e.g., PROJ-123)', }, comment: { description: 'The comment in ADF format or plain string. Example ADF: {"type":"doc","version":1,"content":[{"type":"paragraph","content":[{"type":"text","text":"Comment text"}]}]}', }, }, required: ['issueKey', 'comment'], }, },
  • src/index.ts:122-123 (registration)
    The switch case that registers and routes 'add_comment' tool calls to the appropriate handler method.
    case 'add_comment': return this.commentHandlers.handleAddComment(request.params.arguments);

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/pdogra1299/jira-mcp-server'

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