Skip to main content
Glama
cosmix

JIRA MCP Server

by cosmix

add_comment

Add comments to JIRA issues to provide updates, clarify requirements, or document progress within project workflows.

Instructions

Add a comment to a JIRA issue

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
issueIdOrKeyYesThe ID or key of the issue to add the comment to
bodyYesThe content of the comment (plain text)

Implementation Reference

  • Primary MCP tool handler for 'add_comment'. Validates input (issueIdOrKey, body) and delegates to JiraApiService.addCommentToIssue, returning JSON response.
    case "add_comment": {
      if (
        !args.issueIdOrKey ||
        typeof args.issueIdOrKey !== "string" ||
        !args.body ||
        typeof args.body !== "string"
      ) {
        throw new McpError(
          ErrorCode.InvalidParams,
          "issueIdOrKey and body are required",
        );
      }
      const response = await this.jiraApi.addCommentToIssue(
        args.issueIdOrKey,
        args.body,
      );
      return {
        content: [
          { type: "text", text: JSON.stringify(response, null, 2) },
        ],
      };
  • Core implementation that converts plain text to ADF, POSTs to JIRA API to add comment, and returns cleaned response.
    async addCommentToIssue(
      issueIdOrKey: string,
      body: string
    ): Promise<AddCommentResponse> {
      const adfBody = this.createAdfFromBody(body);
    
      const payload = {
        body: adfBody,
      };
    
      const response = await this.fetchJson<JiraCommentResponse>(
        `/rest/api/3/issue/${issueIdOrKey}/comment`,
        {
          method: "POST",
          body: JSON.stringify(payload),
        }
      );
    
      return {
        id: response.id,
        author: response.author.displayName,
        created: response.created,
        updated: response.updated,
        body: this.extractTextContent(response.body.content),
      };
    }
  • src/index.ts:246-264 (registration)
    Tool registration in MCP server's listTools handler, defining name, description, and input schema.
    {
      name: "add_comment",
      description: "Add a comment to a JIRA issue",
      inputSchema: {
        type: "object",
        properties: {
          issueIdOrKey: {
            type: "string",
            description: "The ID or key of the issue to add the comment to",
          },
          body: {
            type: "string",
            description: "The content of the comment (plain text)",
          },
        },
        required: ["issueIdOrKey", "body"],
        additionalProperties: false,
      },
    },
  • TypeScript interface defining the structure of the response from addCommentToIssue.
    export interface AddCommentResponse {
      id: string;
      author: string;
      created: string;
      updated: string;
      body: string; // Return plain text for simplicity
    }
  • Helper to convert plain text comment to ADF format required by JIRA API.
    private createAdfFromBody(text: string): AdfDoc {
      return {
        version: 1,
        type: "doc",
        content: [
          {
            type: "paragraph",
            content: [
              {
                type: "text",
                text: text,
              },
            ],
          },
        ],
      };
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure but offers minimal information. It states the tool adds a comment but doesn't cover permissions needed, whether comments are editable/deletable after creation, rate limits, error conditions, or what happens on success (e.g., returns comment ID). This leaves significant gaps for a mutation tool.

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, direct sentence with zero wasted words. It's front-loaded with the core action and resource, making it highly efficient and easy to parse at a glance.

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?

For a mutation tool with no annotations and no output schema, the description is incomplete. It doesn't explain behavioral aspects like authentication needs, error handling, or return values, leaving the agent with insufficient context to use the tool effectively beyond basic parameter passing.

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 schema already documents both parameters thoroughly. The description adds no additional parameter semantics beyond what's in the schema (e.g., format examples for issueIdOrKey, body content constraints). This meets the baseline for high schema coverage but doesn't enhance understanding.

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 action ('Add a comment') and target resource ('to a JIRA issue'), making the purpose immediately understandable. However, it doesn't differentiate this tool from sibling tools like 'update_issue' which might also allow comment modifications, or specify if this is for creating new comments only versus editing existing ones.

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. It doesn't mention prerequisites (e.g., needing issue access), exclusions (e.g., not for editing comments), or comparisons to sibling tools like 'update_issue' that might offer overlapping functionality for comment management.

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

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