Skip to main content
Glama

Add Comment

add_comment

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

Instructions

Add a comment to a specified Jira issue

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
issueKeyYesThe issue key (e.g., "PROJ-123")
commentBodyYesThe comment text to add

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNo
createdNo
successYes
commentIdNo

Implementation Reference

  • Core handler function that executes the Jira API POST request to add a comment to the specified issue, returning the new comment ID and creation timestamp.
    export async function addComment(issueKey: string, commentBody: string): Promise<{ id: string; created: string }> {
      const response = await jiraFetch<{
        id: string;
        created: string;
      }>(`/issue/${issueKey}/comment`, {
        method: 'POST',
        body: JSON.stringify({
          body: {
            type: 'doc',
            version: 1,
            content: [
              {
                type: 'paragraph',
                content: [
                  {
                    type: 'text',
                    text: commentBody,
                  },
                ],
              },
            ],
          },
        }),
      });
    
      return {
        id: response.id,
        created: response.created,
      };
    }
  • Zod schema defining input (issueKey, commentBody) and output (success, commentId, created, error) validation for the add_comment tool.
    {
      title: 'Add Comment',
      description: 'Add a comment to a specified Jira issue',
      inputSchema: {
        issueKey: z.string().describe('The issue key (e.g., "PROJ-123")'),
        commentBody: z.string().describe('The comment text to add'),
      },
      outputSchema: {
        success: z.boolean(),
        commentId: z.string().optional(),
        created: z.string().optional(),
        error: z.object({
          message: z.string(),
          statusCode: z.number().optional(),
          details: z.unknown().optional(),
        }).optional(),
      },
    },
  • src/index.ts:117-165 (registration)
    MCP server registration of the 'add_comment' tool, including schema, validation, error handling, and delegation to the core addComment function.
    server.registerTool(
      'add_comment',
      {
        title: 'Add Comment',
        description: 'Add a comment to a specified Jira issue',
        inputSchema: {
          issueKey: z.string().describe('The issue key (e.g., "PROJ-123")'),
          commentBody: z.string().describe('The comment text to add'),
        },
        outputSchema: {
          success: z.boolean(),
          commentId: z.string().optional(),
          created: z.string().optional(),
          error: z.object({
            message: z.string(),
            statusCode: z.number().optional(),
            details: z.unknown().optional(),
          }).optional(),
        },
      },
      async ({ issueKey, commentBody }) => {
        try {
          if (!issueKey || !issueKey.trim()) {
            throw new Error('issueKey is required');
          }
          if (!commentBody || !commentBody.trim()) {
            throw new Error('commentBody is required');
          }
    
          const result = await addComment(issueKey, commentBody);
          const output = {
            success: true,
            commentId: result.id,
            created: result.created,
          };
          return {
            content: [{ type: 'text', text: JSON.stringify(output, null, 2) }],
            structuredContent: output,
          };
        } catch (error) {
          const output = { success: false, ...formatError(error) };
          return {
            content: [{ type: 'text', text: JSON.stringify(output, null, 2) }],
            structuredContent: output,
            isError: true,
          };
        }
      }
    );
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool adds a comment but doesn't mention whether this requires specific permissions, if it's a write operation, what happens on success/failure, or any rate limits. For a mutation tool with zero annotation coverage, this leaves critical behavioral traits undocumented.

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 gets straight to the point with no wasted words. It's appropriately sized for a simple tool and front-loads the core functionality effectively.

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 that an output schema exists (which handles return values), the description doesn't need to explain outputs. However, for a mutation tool with no annotations and multiple sibling tools, the description should provide more context about when to use it and behavioral implications to be complete.

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?

The schema description coverage is 100%, with both parameters ('issueKey' and 'commentBody') clearly documented in the schema. The description doesn't add any additional parameter semantics beyond what the schema already provides, so it meets the baseline for high schema coverage.

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 specified Jira issue'), making the purpose immediately understandable. However, it doesn't differentiate this tool from sibling tools like 'update_issue_field' which might also handle comments, missing the opportunity to clarify its specific scope.

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 like 'update_issue_field' or 'create_issue', nor does it mention prerequisites such as issue existence or user permissions. It simply states what the tool does without contextual usage information.

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

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