Skip to main content
Glama
kornbed

Jira MCP Server for Cursor

add_comment

Add comments to Jira tickets directly from the Cursor editor to provide updates, feedback, or additional information on issues.

Instructions

Add a comment to a Jira ticket

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ticketIdYesThe Jira ticket ID
commentYes

Implementation Reference

  • The async handler function implementing the 'add_comment' tool logic: validates Jira configuration, calls jira.issueComments.addComment to add the comment to the ticket, and returns success or error response.
    async ({ ticketId, comment }: { ticketId: string; comment: JiraComment }) => {
      const configError = validateJiraConfig();
      if (configError) {
        return {
          content: [{ type: "text", text: `Configuration error: ${configError}` }],
        };
      }
    
      try {
        await jira.issueComments.addComment({
          issueIdOrKey: ticketId,
          comment: comment.body,
        });
    
        return {
          content: [{ type: "text", text: `Added comment to ${ticketId}` }],
        };
      } catch (error) {
        return {
          content: [{ type: "text", text: `Failed to add comment: ${(error as Error).message}` }],
        };
      }
    }
  • Zod schema defining the structure of the comment input (body: string) for the add_comment tool.
    const CommentSchema = z.object({
      body: z.string().describe("The comment text"),
    });
  • TypeScript interface for JiraComment used in the add_comment tool input parameters.
    interface JiraComment {
      body: string;
    }
  • src/server.ts:313-343 (registration)
    Registration of the 'add_comment' MCP tool via server.tool(), specifying name, description, input schema, and handler function.
    server.tool(
      "add_comment",
      "Add a comment to a Jira ticket",
      {
        ticketId: z.string().describe("The Jira ticket ID"),
        comment: CommentSchema,
      },
      async ({ ticketId, comment }: { ticketId: string; comment: JiraComment }) => {
        const configError = validateJiraConfig();
        if (configError) {
          return {
            content: [{ type: "text", text: `Configuration error: ${configError}` }],
          };
        }
    
        try {
          await jira.issueComments.addComment({
            issueIdOrKey: ticketId,
            comment: comment.body,
          });
    
          return {
            content: [{ type: "text", text: `Added comment to ${ticketId}` }],
          };
        } catch (error) {
          return {
            content: [{ type: "text", text: `Failed to add comment: ${(error as Error).message}` }],
          };
        }
      }
    );
  • Inline input schema object for the add_comment tool, including ticketId and comment (referencing CommentSchema).
    {
      ticketId: z.string().describe("The Jira ticket ID"),
      comment: CommentSchema,
    },
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the tool 'Adds a comment,' implying a write/mutation operation, but doesn't disclose behavioral traits such as required permissions, whether the action is reversible, rate limits, or what happens on success/failure. 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, efficient sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, making it easy to parse quickly.

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 tool's complexity (a mutation with nested parameters) and lack of annotations or output schema, the description is incomplete. It doesn't cover behavioral aspects like error handling, return values, or usage context, which are critical for effective tool invocation by an AI agent.

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 50%, with 'ticketId' documented but 'comment' only partially described (its 'body' property is documented). The description adds no parameter semantics beyond the schema, such as format examples or constraints. With moderate schema coverage, this meets the baseline but doesn't compensate for gaps.

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 ticket'), providing a specific verb+resource combination. However, it doesn't distinguish this tool from potential sibling alternatives like 'get_comments' or 'update_status' that might also involve comments, leaving room for improvement.

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?

No guidance is provided on when to use this tool versus alternatives. With siblings like 'get_comments' (for reading) and 'create_ticket' (for creating), the description lacks context about prerequisites (e.g., needing an existing ticket) or exclusions, offering minimal usage direction.

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

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