Skip to main content
Glama

get_issue_details

Retrieve comprehensive information about a specific Jira issue by providing its issue key to access details like status, assignee, and description.

Instructions

Get full details of a specific Jira issue

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
issueKeyYesThe issue key (e.g., "PROJ-123")

Implementation Reference

  • Core handler function that executes the tool logic: fetches detailed Jira issue data via API, processes comments (last 5), extracts plain text from ADF format, handles parent issue, and returns structured JiraIssue object.
    export async function getIssueDetails(issueKey: string): Promise<JiraIssue> {
      const fields = ['summary', 'status', 'priority', 'updated', 'description', 'assignee', 'reporter', 'created', 'comment', 'project', 'parent'];
      const params = new URLSearchParams({
        fields: fields.join(','),
      });
    
      const response = await jiraFetch<{
        key: string;
        fields: {
          summary: string;
          status: { name: string };
          priority: { name: string };
          updated: string;
          description?: unknown;
          assignee?: { displayName: string; accountId: string };
          reporter?: { displayName: string; accountId: string };
          created: string;
          comment?: {
            comments: Array<{
              id: string;
              author: { displayName: string };
              body: unknown;
              created: string;
              updated: string;
            }>;
          };
          project?: {
            key: string;
            name: string;
          };
          parent?: {
            key: string;
            fields: {
              summary: string;
              status: { name: string };
              priority: { name: string };
              issuetype: { name: string };
            };
          };
        };
      }>(`/issue/${issueKey}?${params.toString()}`);
    
      const comments: JiraComment[] = response.fields.comment?.comments.slice(-5).map((c) => ({
        id: c.id,
        author: c.author.displayName,
        body: extractTextFromADF(c.body),
        created: c.created,
        updated: c.updated,
      })) || [];
    
      // Build parent object if present
      const parent: JiraIssueParent | undefined = response.fields.parent
        ? {
            key: response.fields.parent.key,
            summary: response.fields.parent.fields.summary,
            status: response.fields.parent.fields.status.name,
            priority: response.fields.parent.fields.priority?.name || 'None',
            issueType: response.fields.parent.fields.issuetype.name,
          }
        : undefined;
    
      return {
        key: response.key,
        summary: response.fields.summary,
        status: response.fields.status.name,
        priority: response.fields.priority?.name || 'None',
        updated: response.fields.updated,
        description: extractTextFromADF(response.fields.description),
        assignee: response.fields.assignee?.displayName,
        reporter: response.fields.reporter?.displayName,
        created: response.fields.created,
        comments,
        project: response.fields.project
          ? { key: response.fields.project.key, name: response.fields.project.name }
          : undefined,
        parent,
      };
    }
  • src/index.ts:349-413 (registration)
    MCP tool registration for 'get_issue_details', including schemas and thin wrapper handler that validates input and calls the core getIssueDetails function.
    server.registerTool(
      'get_issue_details',
      {
        title: 'Get Issue Details',
        description: 'Get full details of a specific Jira issue',
        inputSchema: {
          issueKey: z.string().describe('The issue key (e.g., "PROJ-123")'),
        },
        outputSchema: {
          key: z.string().optional(),
          summary: z.string().optional(),
          description: z.string().optional(),
          status: z.string().optional(),
          priority: z.string().optional(),
          assignee: z.string().optional(),
          reporter: z.string().optional(),
          created: z.string().optional(),
          updated: z.string().optional(),
          comments: z.array(z.object({
            id: z.string(),
            author: z.string(),
            body: z.string(),
            created: z.string(),
            updated: z.string(),
          })).optional(),
          project: z.object({
            key: z.string(),
            name: z.string(),
          }).optional(),
          parent: z.object({
            key: z.string(),
            summary: z.string(),
            status: z.string(),
            priority: z.string(),
            issueType: z.string(),
          }).optional(),
          error: z.object({
            message: z.string(),
            statusCode: z.number().optional(),
            details: z.unknown().optional(),
          }).optional(),
        },
      },
      async ({ issueKey }) => {
        try {
          if (!issueKey || !issueKey.trim()) {
            throw new Error('issueKey is required');
          }
    
          const issue = await getIssueDetails(issueKey);
          const output = { ...issue };
          return {
            content: [{ type: 'text', text: JSON.stringify(output, null, 2) }],
            structuredContent: output,
          };
        } catch (error) {
          const errOutput = formatError(error);
          return {
            content: [{ type: 'text', text: JSON.stringify(errOutput, null, 2) }],
            structuredContent: errOutput,
            isError: true,
          };
        }
      }
    );
  • TypeScript interface defining the structure of the JiraIssue output from getIssueDetails, used for type safety and matching the tool's outputSchema.
    export interface JiraIssue {
      key: string;
      summary: string;
      status: string;
      priority: string;
      updated: string;
      description?: string;
      assignee?: string;
      reporter?: string;
      created?: string;
      comments?: JiraComment[];
      project?: {
        key: string;
        name: string;
      };
      parent?: JiraIssueParent;
    }

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