Skip to main content
Glama
raalarcon9705

raalarcon-jira-mcp-server

get_comments

Retrieve paginated comments for a Jira issue. Control page navigation with startAt and maxResults parameters.

Instructions

Get comments for a Jira issue with pagination support. Returns comments with pagination metadata to help navigate through large comment lists.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
issueKeyYesThe issue key to get comments for (e.g., "PROJ-123")
startAtNoStarting index for pagination (0-based). Use this to get the next page of comments. Default: 0
maxResultsNoMaximum number of comments to return per page (1-100). Use smaller values for faster responses. Default: 50

Implementation Reference

  • The handleCommentTool function handles the 'get_comments' tool case (lines 150-194). It validates args via getCommentsSchema, calls jiraClient.getComments(), and formats the response with pagination metadata (total, startAt, maxResults, hasNextPage, etc.) and essential comment fields (id, author, body, visibility).
    export async function handleCommentTool(
      name: string,
      args: Record<string, unknown>,
      jiraClient: JiraClient
    ) {
      switch (name) {
        case 'create_comment': {
          const validatedArgs = createCommentSchema.cast(args);
          const comment = await jiraClient.createComment(validatedArgs);
          return {
            content: [
              {
                type: 'text',
                text: `Comment ${comment.id} created successfully`,
              },
            ],
          };
        }
    
        case 'get_comments': {
          const validatedArgs = await getCommentsSchema.validate(args);
          const comments = await jiraClient.getComments(validatedArgs);
    
          // Extract essential fields with improved pagination info
          const commentsData = comments;
          const total = commentsData.total || 0;
          const startAt = commentsData.startAt || 0;
          const maxResults = commentsData.maxResults || 50;
    
          const essentialComments = {
            pagination: {
              total,
              startAt,
              maxResults,
              hasNextPage: (startAt + maxResults) < total,
              hasPreviousPage: startAt > 0,
              nextStartAt: (startAt + maxResults) < total
                ? startAt + maxResults
                : null,
              previousStartAt: startAt > 0
                ? Math.max(0, startAt - maxResults)
                : null,
            },
            items: commentsData.comments?.map((comment) => ({
              id: comment.id,
              author: comment.author?.displayName,
              authorId: comment.author?.accountId,
              created: comment.created,
              updated: comment.updated,
              body: comment.body, // Return full body content (ADF format)
              text: comment.body?.content?.[0]?.content?.[0]?.text || '', // Extract text content for backward compatibility
              visibility: comment.visibility?.type || 'public'
            })) || []
          };
    
          return {
            content: [
              {
                type: 'text',
                text: JSON.stringify(essentialComments, null, 2),
              },
            ],
          };
        }
    
        case 'update_comment': {
          const validatedArgs = updateCommentSchema.cast(args);
          const result = await jiraClient.updateComment(validatedArgs);
          return {
            content: [
              {
                type: 'text',
                text: `Comment ${result.id} updated successfully`,
              },
            ],
          };
        }
    
        case 'delete_comment': {
          const validatedArgs = await deleteCommentSchema.validate(args);
          const _result = await jiraClient.deleteComment(validatedArgs);
          return {
            content: [
              {
                type: 'text',
                text: `Comment ${validatedArgs.commentId} deleted successfully`,
              },
            ],
          };
        }
    
        default:
          throw new Error(`Unknown comment tool: ${name}`);
      }
    }
  • getCommentsSchema defines the input validation for 'get_comments': issueKey (required string), startAt (optional number, min 0, default 0), and maxResults (optional number, min 1, max 100, default 50). A GetCommentsInput type is inferred on line 254.
    export const getCommentsSchema = yup.object({
      issueKey: yup.string().required('Issue key is required'),
      startAt: yup.number().min(0).default(0),
      maxResults: yup.number().min(1).max(100).default(50),
    });
  • The tool 'get_comments' is defined as a Tool object with name, description, and inputSchema. It's returned from createCommentTools() which is called in src/index.ts (line 44) during tool listing registration.
    {
      name: 'get_comments',
      description: 'Get comments for a Jira issue with pagination support. Returns comments with pagination metadata to help navigate through large comment lists.',
      inputSchema: {
        type: 'object',
        properties: {
          issueKey: {
            type: 'string',
            description: 'The issue key to get comments for (e.g., "PROJ-123")',
          },
          startAt: {
            type: 'number',
            description: 'Starting index for pagination (0-based). Use this to get the next page of comments. Default: 0',
            default: 0,
            minimum: 0,
          },
          maxResults: {
            type: 'number',
            description: 'Maximum number of comments to return per page (1-100). Use smaller values for faster responses. Default: 50',
            default: 50,
            minimum: 1,
            maximum: 100,
          },
        },
        required: ['issueKey'],
      },
    },
  • The JiraClient.getComments() method calls the Jira API (issueComments.getComments) with issueKey, startAt, and maxResults, returning the raw paginated comments response.
    async getComments(input: GetCommentsInput) {
      try {
        const response = await this.jira.issueComments.getComments({
          issueIdOrKey: input.issueKey,
          startAt: input.startAt,
          maxResults: input.maxResults,
        });
        return response;
      } catch (error) {
        throw new Error(`Failed to get comments: ${error instanceof Error ? error.message : 'Unknown error'}`);
      }
    }
  • src/index.ts:78-84 (registration)
    The routing logic in the MCP server's CallToolRequestSchema handler: when name starts with 'get_comments', it delegates to handleCommentTool().
    } else if (
      name.startsWith('create_comment') ||
      name.startsWith('get_comments') ||
      name.startsWith('update_comment') ||
      name.startsWith('delete_comment')
    ) {
      return await handleCommentTool(name, args || {}, this.jiraClient);
Behavior3/5

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

No annotations are provided, so the description must carry the burden. It mentions pagination support and returning pagination metadata, which is helpful. However, it lacks details on authentication requirements, rate limits, or the fact that it only reads data (implied but not explicit).

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 concise with two sentences, front-loading the key information. Every sentence adds value with no redundancy or filler.

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 there is no output schema, the description mentions return of comments and pagination metadata but omits details on comment structure (e.g., author, body, date). For a simple retrieval tool, it is adequate but not fully 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 input schema has 100% description coverage, so the description adds little beyond referencing pagination. The baseline is 3 because the schema already explains the parameters well; the description does not introduce new meaning.

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 tool retrieves comments for a Jira issue with pagination. It uses a specific verb ('Get') and resource ('comments for a Jira issue'). While it distinguishes from siblings like 'get_issue', it does not explicitly differentiate from other comment tools like 'create_comment', but the purpose is still clear.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies the tool is for reading comments with pagination, but does not provide explicit guidance on when to use it versus alternatives. It does not mention when not to use it or list alternative tools for related tasks.

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

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