Skip to main content
Glama
edrich13

MCP Jira Server

by edrich13

jira_add_comment

Add a comment to a Jira issue by providing its key and the comment text.

Instructions

Add a comment to a Jira issue

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
issueKeyYesThe Jira issue key
commentYesThe comment text to add

Implementation Reference

  • Handler for the jira_add_comment tool. Extracts issueKey and comment from args, calls JiraClient.addComment(), and returns a success message with the comment data.
    case 'jira_add_comment': {
      const comment = await getJiraClient().addComment(
        args.issueKey as string,
        args.comment as string
      );
      return {
        content: [
          {
            type: 'text',
            text: `Successfully added comment to ${args.issueKey}\n\n${JSON.stringify(comment, null, 2)}`,
          },
        ],
      };
    }
  • Input schema definition for jira_add_comment tool. Requires 'issueKey' (string) and 'comment' (string).
    {
      name: 'jira_add_comment',
      description: 'Add a comment to a Jira issue',
      inputSchema: {
        type: 'object',
        properties: {
          issueKey: {
            type: 'string',
            description: 'The Jira issue key',
          },
          comment: {
            type: 'string',
            description: 'The comment text to add',
          },
        },
        required: ['issueKey', 'comment'],
      },
    },
  • src/index.ts:56-297 (registration)
    The tool is registered as part of the 'tools' array, which is served via ListToolsRequestSchema handler and dispatched via CallToolRequestSchema switch statement.
    const tools: Tool[] = [
      {
        name: 'jira_get_issue',
        description: 'Get details of a specific Jira issue by its key (e.g., PROJ-123)',
        inputSchema: {
          type: 'object',
          properties: {
            issueKey: {
              type: 'string',
              description: 'The Jira issue key (e.g., PROJ-123)',
            },
          },
          required: ['issueKey'],
        },
      },
      {
        name: 'jira_search_issues',
        description: 'Search for Jira issues using JQL (Jira Query Language). Examples: "project = PROJ AND status = Open", "assignee = currentUser() AND status != Done"',
        inputSchema: {
          type: 'object',
          properties: {
            jql: {
              type: 'string',
              description: 'JQL query string to search for issues',
            },
            maxResults: {
              type: 'number',
              description: 'Maximum number of results to return (default: 50)',
              default: 50,
            },
          },
          required: ['jql'],
        },
      },
      {
        name: 'jira_create_issue',
        description: 'Create a new Jira issue in a specified project',
        inputSchema: {
          type: 'object',
          properties: {
            projectKey: {
              type: 'string',
              description: 'The project key where the issue will be created',
            },
            summary: {
              type: 'string',
              description: 'Brief summary/title of the issue',
            },
            description: {
              type: 'string',
              description: 'Detailed description of the issue',
            },
            issueType: {
              type: 'string',
              description: 'Type of issue (e.g., Bug, Task, Story, Epic)',
            },
            priority: {
              type: 'string',
              description: 'Priority level (e.g., High, Medium, Low)',
            },
            assignee: {
              type: 'string',
              description: 'Username of the person to assign the issue to',
            },
            labels: {
              type: 'array',
              items: {
                type: 'string',
              },
              description: 'Array of labels to add to the issue',
            },
            components: {
              type: 'array',
              items: {
                type: 'string',
              },
              description: 'Array of component names',
            },
            customFields: {
              type: 'object',
              description: 'Map of additional Jira field IDs/keys (e.g., customfield_10211) to include in the fields payload',
              additionalProperties: true,
            },
          },
          required: ['projectKey', 'summary', 'issueType'],
        },
      },
      {
        name: 'jira_update_issue',
        description: 'Update an existing Jira issue',
        inputSchema: {
          type: 'object',
          properties: {
            issueKey: {
              type: 'string',
              description: 'The Jira issue key to update',
            },
            summary: {
              type: 'string',
              description: 'New summary/title for the issue',
            },
            description: {
              type: 'string',
              description: 'New description for the issue',
            },
            assignee: {
              type: 'string',
              description: 'Username to assign the issue to',
            },
            priority: {
              type: 'string',
              description: 'New priority level',
            },
            labels: {
              type: 'array',
              items: {
                type: 'string',
              },
              description: 'New array of labels',
            },
            status: {
              type: 'string',
              description: 'New status/workflow state (e.g., "In Progress", "Done")',
            },
            customFields: {
              type: 'object',
              description: 'Map of additional Jira field IDs/keys (e.g., customfield_10211) to include in the fields payload',
              additionalProperties: true,
            },
          },
          required: ['issueKey'],
        },
      },
      {
        name: 'jira_add_comment',
        description: 'Add a comment to a Jira issue',
        inputSchema: {
          type: 'object',
          properties: {
            issueKey: {
              type: 'string',
              description: 'The Jira issue key',
            },
            comment: {
              type: 'string',
              description: 'The comment text to add',
            },
          },
          required: ['issueKey', 'comment'],
        },
      },
      {
        name: 'jira_get_comments',
        description: 'Get all comments from a Jira issue',
        inputSchema: {
          type: 'object',
          properties: {
            issueKey: {
              type: 'string',
              description: 'The Jira issue key',
            },
          },
          required: ['issueKey'],
        },
      },
      {
        name: 'jira_get_projects',
        description: 'List all available Jira projects',
        inputSchema: {
          type: 'object',
          properties: {},
        },
      },
      {
        name: 'jira_get_project',
        description: 'Get details of a specific Jira project',
        inputSchema: {
          type: 'object',
          properties: {
            projectKey: {
              type: 'string',
              description: 'The project key',
            },
          },
          required: ['projectKey'],
        },
      },
      {
        name: 'jira_get_issue_types',
        description: 'Get available issue types for a project',
        inputSchema: {
          type: 'object',
          properties: {
            projectKey: {
              type: 'string',
              description: 'The project key',
            },
          },
          required: ['projectKey'],
        },
      },
      {
        name: 'jira_assign_issue',
        description: 'Assign a Jira issue to a user',
        inputSchema: {
          type: 'object',
          properties: {
            issueKey: {
              type: 'string',
              description: 'The Jira issue key',
            },
            assignee: {
              type: 'string',
              description: 'Username to assign the issue to',
            },
          },
          required: ['issueKey', 'assignee'],
        },
      },
      {
        name: 'jira_delete_issue',
        description: 'Delete a Jira issue permanently',
        inputSchema: {
          type: 'object',
          properties: {
            issueKey: {
              type: 'string',
              description: 'The Jira issue key to delete',
            },
          },
          required: ['issueKey'],
        },
      },
      {
        name: 'jira_get_current_user',
        description: 'Get information about the currently authenticated user',
        inputSchema: {
          type: 'object',
          properties: {},
        },
      },
    ];
  • JiraClient.addComment() method. Makes a POST request to /rest/api/2/issue/{issueKey}/comment with the comment body and returns the created JiraComment.
    async addComment(issueKey: string, comment: string): Promise<JiraComment> {
      const response = await this.client.post(`/issue/${issueKey}/comment`, {
        body: comment
      });
      return response.data;
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.3

TDQS

B3.3/5.0
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. 'Add' implies mutation, but it does not disclose whether permissions are needed, whether comments are appended to existing ones, or what happens on invalid issue keys. It is not contradictory, but it is minimal.

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, tightly worded sentence with the action front-loaded. Every word contributes to meaning, with no redundant or filler content.

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?

The tool is simple with two self-explanatory parameters and full schema coverage, so the description plus schema are mostly adequate. However, the absence of any output schema or behavioral context leaves some uncertainty about return values and side effects, preventing a higher score.

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%, with issueKey and comment both described in the schema. The tool description adds no extra meaning beyond what the schema already states, so the baseline score of 3 applies.

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 uses a specific verb 'Add' and a clear resource 'a comment to a Jira issue,' making the tool's function unambiguous. It is easily distinguished from siblings like jira_create_issue (creates an issue) and jira_get_comments (retrieves comments).

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, no prerequisites, and no exclusions. It does not mention that the issue must exist, that comments are appended, or that jira_get_comments would be the read counterpart.

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