Skip to main content
Glama

get_jira_issue

Retrieve detailed information for a specific Jira issue by providing its issue key, enabling efficient issue tracking and management on the Jira MCP Server.

Instructions

Get details for a specific Jira issue by key

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
issue_keyYesThe issue key (e.g., PROJECT-123)

Implementation Reference

  • The handler function that implements the core logic for retrieving a specific Jira issue by its key using the JIRA Python client library. It handles connection if needed, fetches the issue, extracts key fields like summary, status, assignee, comments, and custom fields, and returns a structured JiraIssueResult.
    def get_jira_issue(self, issue_key: str) -> JiraIssueResult:
        """Get details for a specific issue by key"""
        if not self.client:
            if not self.connect():
                # Connection failed - provide clear error message
                raise ValueError(
                    f"Failed to connect to Jira server at {self.server_url}. Check your authentication credentials."
                )
    
        try:
            issue = self.client.issue(issue_key)
    
            # Extract comments if available
            comments = []
            if hasattr(issue.fields, "comment") and hasattr(
                issue.fields.comment, "comments"
            ):
                for comment in issue.fields.comment.comments:
                    comments.append(
                        {
                            "author": (
                                getattr(
                                    comment.author, "displayName", str(comment.author)
                                )
                                if hasattr(comment, "author")
                                else "Unknown"
                            ),
                            "body": comment.body,
                            "created": comment.created,
                        }
                    )
    
            # Create a fields dictionary with custom fields
            fields = {}
            for field_name in dir(issue.fields):
                if not field_name.startswith("_") and field_name not in [
                    "comment",
                    "attachment",
                    "summary",
                    "description",
                    "status",
                    "assignee",
                    "reporter",
                    "created",
                    "updated",
                ]:
                    value = getattr(issue.fields, field_name)
                    if value is not None:
                        # Handle special field types
                        if hasattr(value, "name"):
                            fields[field_name] = value.name
                        elif hasattr(value, "value"):
                            fields[field_name] = value.value
                        elif isinstance(value, list):
                            if len(value) > 0:
                                if hasattr(value[0], "name"):
                                    fields[field_name] = [item.name for item in value]
                                else:
                                    fields[field_name] = value
                        else:
                            fields[field_name] = str(value)
    
            return JiraIssueResult(
                key=issue.key,
                summary=issue.fields.summary,
                description=issue.fields.description,
                status=(
                    issue.fields.status.name
                    if hasattr(issue.fields, "status")
                    else None
                ),
                assignee=(
                    issue.fields.assignee.displayName
                    if hasattr(issue.fields, "assignee") and issue.fields.assignee
                    else None
                ),
                reporter=(
                    issue.fields.reporter.displayName
                    if hasattr(issue.fields, "reporter") and issue.fields.reporter
                    else None
                ),
                created=(
                    issue.fields.created if hasattr(issue.fields, "created") else None
                ),
                updated=(
                    issue.fields.updated if hasattr(issue.fields, "updated") else None
                ),
                fields=fields,
                comments=comments,
            )
        except Exception as e:
            print(f"Failed to get issue {issue_key}: {type(e).__name__}: {str(e)}")
            raise ValueError(
                f"Failed to get issue {issue_key}: {type(e).__name__}: {str(e)}"
            )
  • Input schema definition for the 'get_jira_issue' tool, specifying that it requires an 'issue_key' string parameter.
        name=JiraTools.GET_ISSUE.value,
        description="Get details for a specific Jira issue by key",
        inputSchema={
            "type": "object",
            "properties": {
                "issue_key": {
                    "type": "string",
                    "description": "The issue key (e.g., PROJECT-123)",
                }
            },
            "required": ["issue_key"],
        },
    ),
  • Pydantic model defining the output structure returned by the get_jira_issue handler, including essential issue fields and optional detailed fields.
    class JiraIssueResult(BaseModel):
        key: str
        summary: str
        description: Optional[str] = None
        status: Optional[str] = None
        assignee: Optional[str] = None
        reporter: Optional[str] = None
        created: Optional[str] = None
        updated: Optional[str] = None
        fields: Optional[Dict[str, Any]] = None
        comments: Optional[List[Dict[str, Any]]] = None
        watchers: Optional[Dict[str, Any]] = None
        attachments: Optional[List[Dict[str, Any]]] = None
        subtasks: Optional[List[Dict[str, Any]]] = None
        project: Optional[Dict[str, Any]] = None
        issue_links: Optional[List[Dict[str, Any]]] = None
        worklog: Optional[List[Dict[str, Any]]] = None
        timetracking: Optional[Dict[str, Any]] = None
  • Registration of the 'get_jira_issue' tool in the MCP server's call_tool handler, which extracts the issue_key argument and invokes the JiraServer.get_jira_issue method.
    case JiraTools.GET_ISSUE.value:
        logger.info("Calling synchronous tool get_jira_issue...")
        issue_key = arguments.get("issue_key")
        if not issue_key:
            raise ValueError("Missing required argument: issue_key")
        result = jira_server.get_jira_issue(issue_key)
        logger.info("Synchronous tool get_jira_issue completed.")
  • Enum defining the tool names, including 'get_jira_issue' used for registration in list_tools and call_tool.
    class JiraTools(str, Enum):
        GET_PROJECTS = "get_jira_projects"
        GET_ISSUE = "get_jira_issue"
        SEARCH_ISSUES = "search_jira_issues"
        CREATE_ISSUE = "create_jira_issue"
        CREATE_ISSUES = "create_jira_issues"
        ADD_COMMENT = "add_jira_comment"
        GET_TRANSITIONS = "get_jira_transitions"
        TRANSITION_ISSUE = "transition_jira_issue"
        CREATE_PROJECT = "create_jira_project"
        GET_PROJECT_ISSUE_TYPES = "get_jira_project_issue_types"
Behavior2/5

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

With no annotations provided, the description carries full burden but only states it 'gets details' without specifying what details are returned, error handling, authentication needs, or rate limits. This leaves significant behavioral gaps for a read operation.

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 a single, efficient sentence that front-loads the core action and resource. Every word earns its place with zero waste.

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

Completeness2/5

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

Given no annotations and no output schema, the description is incomplete for a tool that presumably returns structured issue data. It doesn't explain return values, error cases, or how it differs from sibling tools, leaving the agent with insufficient context.

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 description coverage is 100%, so the schema already documents the 'issue_key' parameter fully. The description adds no additional meaning beyond what the schema provides, meeting the baseline for high coverage.

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 verb ('Get details') and resource ('specific Jira issue'), making the purpose immediately understandable. It doesn't explicitly distinguish from siblings like 'search_jira_issues' or 'get_jira_project_issue_types', which would require a 5.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'search_jira_issues' for multiple issues or 'get_jira_project_issue_types' for metadata. It lacks any context about prerequisites or exclusions.

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

Related 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/InfinitIQ-Tech/mcp-jira'

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