Skip to main content
Glama

jira_get_issue

Retrieve detailed information about a specific JIRA issue by providing the issue key. This tool integrates with JIRA MCP Server to streamline access to ticket details directly within your IDE.

Instructions

Retrieves detailed information about a specific JIRA issue

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
issueKeyYes

Implementation Reference

  • GetIssueHandler class implements the core execution logic for jira_get_issue: validates params, executes use case, formats output, and enhances error messages.
    export class GetIssueHandler extends BaseToolHandler<GetIssueParams, string> { private formatter: IssueFormatter; /** * Create a new GetIssueHandler with use case and validator * * @param getIssueUseCase - Use case for retrieving issue details * @param issueParamsValidator - Validator for issue parameters */ constructor( private readonly getIssueUseCase: GetIssueUseCase, private readonly issueParamsValidator: IssueParamsValidator, ) { super("JIRA", "Get Issue"); this.formatter = new IssueFormatter(); } /** * Execute the handler logic * Retrieves issue details and formats them using the formatter * * @param params - Parameters for issue retrieval */ protected async execute(params: GetIssueParams): Promise<string> { try { // Step 1: Validate parameters const validatedParams = this.issueParamsValidator.validateGetIssueParams(params); this.logger.info(`Getting JIRA issue: ${validatedParams.issueKey}`); // Step 2: Get issue using use case const issue = await this.getIssueUseCase.execute(validatedParams); // Step 3: Format issue using the formatter return this.formatter.format(issue); } catch (error) { this.logger.error(`Failed to get issue: ${error}`); throw this.enhanceError(error, params); } } /** * Enhance error messages for better user guidance */ private enhanceError(error: unknown, params?: GetIssueParams): Error { const issueContext = params?.issueKey ? ` for issue ${params.issueKey}` : ""; if (error instanceof JiraNotFoundError) { return new Error( `❌ **Issue Not Found**\n\nNo issue found${issueContext}.\n\n**Solutions:**\n- Verify the issue key is correct\n- Check if the issue exists\n- Verify you have permission to view the issue\n\n**Example:** \`jira_get_issue issueKey="PROJ-123"\``, ); } if (error instanceof JiraPermissionError) { return new Error( `❌ **Permission Denied**\n\nYou don't have permission to view the issue${issueContext}.\n\n**Solutions:**\n- Check your JIRA permissions\n- Contact your JIRA administrator\n- Verify you have access to the project\n\n**Required Permissions:** Browse Projects`, ); } if (error instanceof JiraApiError) { return new Error( `❌ **JIRA API Error**\n\n${error.message}\n\n**Solutions:**\n- Verify the issue key is valid (format: PROJ-123)\n- Check your JIRA connection\n- Try with a different issue\n\n**Example:** \`jira_get_issue issueKey="PROJ-123"\``, ); } if (error instanceof Error) { return new Error( `❌ **Issue Retrieval Failed**\n\n${error.message}${issueContext}\n\n**Solutions:**\n- Check your parameters are valid\n- Verify your JIRA connection\n- Try with a different issue\n\n**Example:** \`jira_get_issue issueKey="PROJ-123"\``, ); } return new Error( `❌ **Unknown Error**\n\nAn unknown error occurred during issue retrieval${issueContext}.\n\nPlease check your parameters and try again.`, ); }
  • getIssueParamsSchema defines the input validation schema (issueKey required, fields optional). issueKeySchema: z.string().regex(/^[A-Z]+-\d+$/, "Issue key must be in the format PROJECT-123") is on lines 17-20.
    export const getIssueParamsSchema = z.object({ issueKey: issueKeySchema, fields: z.array(z.string()).optional(), });
  • Tool registration configuration: defines name, description, input params schema, and binds the handler.
    name: "jira_get_issue", description: "Retrieves detailed information about a specific JIRA issue", params: { issueKey: issueKeySchema }, handler: tools.jira_get_issue.handle.bind(tools.jira_get_issue), },
  • Factory creates the jira_get_issue tool object by wrapping the GetIssueHandler.handle method.
    jira_get_issue: { handle: async (args: unknown) => getIssueHandler.handle(args),
  • Core issueKeySchema used in tool params validation.
    export const issueKeySchema = z .string() .regex(/^[A-Z]+-\d+$/, "Issue key must be in the format PROJECT-123");

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

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