Skip to main content
Glama
raalarcon9705

raalarcon-jira-mcp-server

update_comment

Update an existing comment on a Jira issue. Supports Markdown for rich formatting and mentions using accountId.

Instructions

Update an existing comment on a Jira issue. Supports plain text or Markdown for rich formatting (headings, lists, code blocks, links, etc.). Markdown is automatically converted to ADF. For mentions, use format: @[accountId:displayName] (get accountId from get_users tool).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
issueKeyYesThe issue key containing the comment
commentIdYesThe ID of the comment to update
bodyYesThe new comment text. Supports plain text or Markdown for rich formatting (headings, lists, code blocks, links, etc.). Markdown will be automatically converted to ADF. For mentions, use format: @[accountId:displayName] (get accountId from get_users tool).
visibilityNoComment visibility settings

Implementation Reference

  • Tool handler for 'update_comment' that validates args via schema, calls jiraClient.updateComment(), and returns success message.
    case 'update_comment': {
      const validatedArgs = updateCommentSchema.cast(args);
      const result = await jiraClient.updateComment(validatedArgs);
      return {
        content: [
          {
            type: 'text',
            text: `Comment ${result.id} updated successfully`,
          },
        ],
      };
    }
  • JiraClient.updateComment() method that calls the Jira API's issueComments.updateComment with issueKey, commentId, body (ADF), and visibility.
    // Update comment
    async updateComment(input: UpdateCommentInput) {
      try {
        // The schema now handles the conversion from string to ADF
        // So input.body is already an ADF object
        const adfBody = input.body as UpdateComment['body'];
    
        const response = await this.jira.issueComments.updateComment({
          issueIdOrKey: input.issueKey,
          id: input.commentId,
          body: adfBody,
          visibility: input.visibility,
        });
        return response;
      } catch (error: unknown) {
        const errorDetails = {
          message: (error as Error).message,
          status: (error as JiraError).status,
          statusText: (error as JiraError).statusText,
          response: (error as JiraError).response?.data,
          request: {
            issueKey: input.issueKey,
            commentId: input.commentId,
            body: input.body,
            visibility: input.visibility
          }
        };
        console.error('Comment update error details:', JSON.stringify(errorDetails, null, 2));
        throw new Error(`Failed to update comment: ${JSON.stringify(errorDetails, null, 2)}`);
      }
    }
  • Yup validation schema for update_comment input: requires issueKey, commentId, body (with Markdown-to-ADF conversion), and optional visibility.
    export const updateCommentSchema = yup.object({
      issueKey: yup.string().required('Issue key is required'),
      commentId: yup.string().required('Comment ID is required'),
      body: yup.mixed()
        .required('Comment body is required')
        .test('is-string', 'Body must be a string', function (value) {
          return typeof value === 'string';
        })
        .transform(function (value) {
          // If it's a string and looks like markdown, convert to ADF
          if (typeof value === 'string' && isMarkdown(value)) {
            return markdownToADF(value);
          }
          // For plain text, create a simple ADF paragraph
          return {
            version: 1,
            type: 'doc',
            content: [
              {
                type: 'paragraph',
                content: [
                  {
                    type: 'text',
                    text: value
                  }
                ]
              }
            ]
          };
        }),
      visibility: yup.object({
        type: yup.string().oneOf(['role', 'group']).optional(),
        value: yup.string().optional(),
      }).optional().default(undefined),
    });
  • Tool registration/definition in createCommentTools: name 'update_comment', description, and inputSchema with issueKey, commentId, body, visibility.
    {
      name: 'update_comment',
      description: 'Update an existing comment on a Jira issue. Supports plain text or Markdown for rich formatting (headings, lists, code blocks, links, etc.). Markdown is automatically converted to ADF. For mentions, use format: @[accountId:displayName] (get accountId from get_users tool).',
      inputSchema: {
        type: 'object',
        properties: {
          issueKey: {
            type: 'string',
            description: 'The issue key containing the comment',
          },
          commentId: {
            type: 'string',
            description: 'The ID of the comment to update',
          },
          body: {
            type: 'string',
            description: 'The new comment text. Supports plain text or Markdown for rich formatting (headings, lists, code blocks, links, etc.). Markdown will be automatically converted to ADF. For mentions, use format: @[accountId:displayName] (get accountId from get_users tool).',
          },
          visibility: {
            type: 'object',
            properties: {
              type: {
                type: 'string',
                enum: ['role', 'group'],
                description: 'The visibility type',
              },
              value: {
                type: 'string',
                description: 'The role or group name',
              },
            },
            description: 'Comment visibility settings',
          },
        },
        required: ['issueKey', 'commentId', 'body'],
      },
    },
  • src/index.ts:78-84 (registration)
    Routes 'update_comment' tool calls (via name prefix match) to handleCommentTool.
    } else if (
      name.startsWith('create_comment') ||
      name.startsWith('get_comments') ||
      name.startsWith('update_comment') ||
      name.startsWith('delete_comment')
    ) {
      return await handleCommentTool(name, args || {}, this.jiraClient);
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description adds behavioral information beyond the schema, notably that Markdown is automatically converted to ADF and mentions use a specific format. However, it does not disclose permissions, reversibility, or other side effects, which would be needed given no annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise with three sentences, front-loaded with the main purpose, and each sentence adds necessary detail without repetition or fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema and a nested parameter, the description covers purpose, formatting, and mentions but does not clarify return values, error conditions, or the visibility parameter in detail. It is adequate but has gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3. The description adds value by explaining ADF conversion for the body parameter and the mention format, which are not in the schema. However, it does not elaborate on the visibility parameter.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Update an existing comment on a Jira issue,' using a specific verb and resource. It distinguishes from sibling tools like create_comment and delete_comment.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description does not provide guidance on when to use this tool versus alternatives like create_comment or get_comments. It lacks explicit context about usage scenarios or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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

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