Skip to main content
Glama
cosmix

JIRA MCP Server

by cosmix

get_issue

Retrieve detailed JIRA issue information including comments by providing the issue ID or key to access specific project data.

Instructions

Get detailed information about a specific JIRA issue including comments

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
issueIdYesThe ID or key of the JIRA issue

Implementation Reference

  • src/index.ts:115-130 (registration)
    Registration of the get_issue MCP tool, including its name, description, and input schema requiring an issueId string.
    {
      name: "get_issue",
      description:
        "Get detailed information about a specific JIRA issue including comments",
      inputSchema: {
        type: "object",
        properties: {
          issueId: {
            type: "string",
            description: "The ID or key of the JIRA issue",
          },
        },
        required: ["issueId"],
        additionalProperties: false,
      },
    },
  • MCP tool handler for get_issue: validates the issueId argument and calls the JiraApiService to fetch the issue with comments, then returns JSON stringified response.
    case "get_issue": {
      if (!args.issueId || typeof args.issueId !== "string") {
        throw new McpError(
          ErrorCode.InvalidParams,
          "Issue ID is required",
        );
      }
      const response = await this.jiraApi.getIssueWithComments(
        args.issueId,
      );
      return {
        content: [
          { type: "text", text: JSON.stringify(response, null, 2) },
        ],
      };
    }
  • Core helper function implementing the logic to retrieve a JIRA issue with comments: fetches issue and comments via API, cleans data, extracts mentions from ADF content, enriches with epic details.
    async getIssueWithComments(issueId: string): Promise<CleanJiraIssue> {
      const params = new URLSearchParams({
        fields: [
          "id",
          "key",
          "summary",
          "description",
          "status",
          "created",
          "updated",
          "parent",
          "subtasks",
          "customfield_10014",
          "issuelinks",
        ].join(","),
        expand: "names,renderedFields",
      });
    
      let issueData, commentsData;
      try {
        [issueData, commentsData] = await Promise.all([
          this.fetchJson<any>(`/rest/api/3/issue/${issueId}?${params}`),
          this.fetchJson<any>(`/rest/api/3/issue/${issueId}/comment`),
        ]);
      } catch (error: any) {
        if (error instanceof Error && error.message.includes("(Status: 404)")) {
          throw new Error(`Issue not found: ${issueId}`);
        }
    
        throw error;
      }
    
      const issue = this.cleanIssue(issueData);
      const comments = commentsData.comments.map((comment: any) =>
        this.cleanComment(comment)
      );
    
      const commentMentions = comments.flatMap(
        (comment: CleanComment) => comment.mentions
      );
      issue.relatedIssues = [...issue.relatedIssues, ...commentMentions];
    
      issue.comments = comments;
    
      if (issue.epicLink) {
        try {
          const epicData = await this.fetchJson<any>(
            `/rest/api/3/issue/${issue.epicLink.key}?fields=summary`
          );
          issue.epicLink.summary = epicData.fields?.summary;
        } catch (error) {
          console.error("Failed to fetch epic details:", error);
        }
      }
    
      return issue;
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.0.0

TDQS

A3.6/5.0
Behavior2/5

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

No annotations are provided, and the description does not disclose behavioral traits such as read-only nature, permissions, or response format, leaving the agent uninformed about side effects.

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?

Single sentence that is front-loaded with key action and resource, no unnecessary words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple tool with one parameter and no output schema, the description adequately explains the purpose, though it could mention return format or data scope for full completeness.

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 coverage is 100% for the single parameter, and the description adds no new meaning beyond the schema's description of issueId. Baseline 3 applies as per rules.

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 clearly states 'Get detailed information about a specific JIRA issue including comments', specifying the verb, resource, and distinguishing it from sibling tools like get_epic_children or get_transitions.

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?

Implied usage for retrieving detailed info for one issue, but no explicit guidance on when to use versus search_issues or alternatives, nor any when-not-to-use conditions.

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