Skip to main content
Glama

add_comment

Add comments to Jira issues to provide updates, document progress, or communicate with team members about specific tasks.

Instructions

Add a comment to a Jira issue

Input Schema

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

Implementation Reference

  • The handler function that executes the add_comment tool. It validates inputs, converts plain text comments to ADF format if necessary, posts the comment to the Jira API, and returns success or formatted error response.
    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 input schema and metadata definition for the add_comment tool, specifying required parameters and descriptions.
    {
      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 dispatch/registration point in the MCP server where tool calls to 'add_comment' are routed to the handler.
    case 'add_comment':
      return this.commentHandlers.handleAddComment(request.params.arguments);
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action ('Add a comment') but lacks details on permissions needed, whether it's idempotent, error handling, or response format. This is a significant gap for a mutation tool with zero annotation coverage.

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 a single, efficient sentence with zero waste. It's appropriately sized and front-loaded, clearly stating the tool's purpose without unnecessary elaboration.

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

Completeness2/5

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

Given the complexity of a mutation tool with no annotations and no output schema, the description is incomplete. It doesn't address behavioral aspects like authentication needs, potential side effects, or what the tool returns, leaving gaps that could hinder an AI agent's correct invocation.

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

Parameters3/5

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

Schema description coverage is 100%, so the input schema already documents both parameters thoroughly. The description doesn't add any meaning beyond what the schema provides, such as clarifying the comment format or issueKey usage. Baseline 3 is appropriate when the schema does the heavy lifting.

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

Purpose4/5

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

The description clearly states the verb ('Add') and resource ('a comment to a Jira issue'), making the purpose specific and understandable. However, it doesn't distinguish this tool from potential alternatives like 'update_issue' which might also handle comments, leaving room for improvement in sibling differentiation.

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 provides no guidance on when to use this tool versus alternatives. With sibling tools like 'update_issue' that might modify issues, there's no indication of whether this is the preferred method for adding comments or if it has specific prerequisites, such as requiring an existing issue.

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

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