Skip to main content
Glama

get_jira_issue

Retrieve detailed Jira issue information including status, assignee, priority, and descriptions by providing the issue key for project tracking and management.

Instructions

Get detailed information about a Jira issue by its key (e.g., PROJ-123)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
issueKeyYesThe Jira issue key (e.g., PROJ-123, TASK-456)

Implementation Reference

  • Handler function that fetches Jira issue details by key, extracts and formats key fields (summary, status, assignee, etc.), cleans description, and returns markdown text content plus structured data with full issue info and browse URL.
    async (args: { issueKey: string }) => { try { const url = `${JIRA_URL}/rest/api/3/issue/${args.issueKey}`; const response = await fetch(url, { method: "GET", headers: getJiraHeaders(), }); if (!response.ok) { const errorText = await response.text(); return { content: [ { type: "text", text: `Failed to fetch Jira issue ${args.issueKey}: ${response.status} ${response.statusText}\n${errorText}`, }, ], isError: true, }; } const issueData = await response.json() as any; // Extract key information from the issue const issue = issueData; const fields = issue.fields; const summary = fields.summary || 'No summary'; const description = fields.description || 'No description'; const status = fields.status?.name || 'Unknown status'; const assignee = fields.assignee?.displayName || 'Unassigned'; const reporter = fields.reporter?.displayName || 'Unknown reporter'; const priority = fields.priority?.name || 'No priority'; const issueType = fields.issuetype?.name || 'Unknown type'; const created = fields.created ? new Date(fields.created).toLocaleDateString() : 'Unknown'; const updated = fields.updated ? new Date(fields.updated).toLocaleDateString() : 'Unknown'; // Format description (remove HTML tags if present) const cleanDescription = typeof description === 'string' ? description.replace(/<[^>]*>/g, '').trim() : JSON.stringify(description); return { content: [ { type: "text", text: `**${issue.key}: ${summary}** **Status:** ${status} **Type:** ${issueType} **Priority:** ${priority} **Assignee:** ${assignee} **Reporter:** ${reporter} **Created:** ${created} **Updated:** ${updated} **Description:** ${cleanDescription} **Full Issue Data:** Available in structured content below.`, }, ], structuredContent: { issueKey: issue.key, summary, description: cleanDescription, status, issueType, priority, assignee, reporter, created, updated, url: `${JIRA_URL}/browse/${issue.key}`, fullData: issueData, }, }; } catch (error) { return { content: [ { type: "text", text: `Error fetching Jira issue ${args.issueKey}: ${error instanceof Error ? error.message : String(error)}`, }, ], isError: true, }; } }
  • Input schema for the get_jira_issue tool, defining the required 'issueKey' parameter as a string with description.
    issueKey: z.string().describe("The Jira issue key (e.g., PROJ-123, TASK-456)"), },
  • src/server.ts:47-145 (registration)
    MCP tool registration for 'get_jira_issue', including title, description, input schema using Zod, and inline handler function.
    mcp.registerTool( "get_jira_issue", { title: "Get Jira Issue", description: "Get detailed information about a Jira issue by its key (e.g., PROJ-123)", inputSchema: { issueKey: z.string().describe("The Jira issue key (e.g., PROJ-123, TASK-456)"), }, }, async (args: { issueKey: string }) => { try { const url = `${JIRA_URL}/rest/api/3/issue/${args.issueKey}`; const response = await fetch(url, { method: "GET", headers: getJiraHeaders(), }); if (!response.ok) { const errorText = await response.text(); return { content: [ { type: "text", text: `Failed to fetch Jira issue ${args.issueKey}: ${response.status} ${response.statusText}\n${errorText}`, }, ], isError: true, }; } const issueData = await response.json() as any; // Extract key information from the issue const issue = issueData; const fields = issue.fields; const summary = fields.summary || 'No summary'; const description = fields.description || 'No description'; const status = fields.status?.name || 'Unknown status'; const assignee = fields.assignee?.displayName || 'Unassigned'; const reporter = fields.reporter?.displayName || 'Unknown reporter'; const priority = fields.priority?.name || 'No priority'; const issueType = fields.issuetype?.name || 'Unknown type'; const created = fields.created ? new Date(fields.created).toLocaleDateString() : 'Unknown'; const updated = fields.updated ? new Date(fields.updated).toLocaleDateString() : 'Unknown'; // Format description (remove HTML tags if present) const cleanDescription = typeof description === 'string' ? description.replace(/<[^>]*>/g, '').trim() : JSON.stringify(description); return { content: [ { type: "text", text: `**${issue.key}: ${summary}** **Status:** ${status} **Type:** ${issueType} **Priority:** ${priority} **Assignee:** ${assignee} **Reporter:** ${reporter} **Created:** ${created} **Updated:** ${updated} **Description:** ${cleanDescription} **Full Issue Data:** Available in structured content below.`, }, ], structuredContent: { issueKey: issue.key, summary, description: cleanDescription, status, issueType, priority, assignee, reporter, created, updated, url: `${JIRA_URL}/browse/${issue.key}`, fullData: issueData, }, }; } catch (error) { return { content: [ { type: "text", text: `Error fetching Jira issue ${args.issueKey}: ${error instanceof Error ? error.message : String(error)}`, }, ], isError: true, }; } } );
  • Helper function to create standardized HTTP headers for Jira API requests, including Basic Auth from env vars, used by get_jira_issue handler.
    function getJiraHeaders(): Record<string, string> { const auth = Buffer.from(`${JIRA_EMAIL}:${JIRA_API_TOKEN}`).toString('base64'); return { 'Authorization': `Basic ${auth}`, 'Accept': 'application/json', 'Content-Type': 'application/json', }; }

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

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