jira_get_issue_types
Retrieve available Jira issue types including Bugs, Stories, Tasks, and Epics. Get global issue types or filter by specific project to understand workflow options.
Instructions
Retrieves available issue types. Can get global issue types or project-specific issue types including regular issues and subtasks (Bug, Story, Task, Epic, etc.).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectKey | No | Project key to get issue types for specific project (optional - if not provided, returns global issue types) |
Implementation Reference
- src/tools/get-issue-types.ts:30-49 (handler)The main handler function that validates the input using the schema, fetches issue types from Jira API via helper, formats the response, and handles errors.
export async function handleGetIssueTypes(input: unknown): Promise<McpToolResponse> { try { const validated = validateInput(GetIssueTypesInputSchema, input); if (validated.projectKey) { log.info(`Getting issue types for project ${validated.projectKey}...`); } else { log.info('Getting global issue types...'); } const issueTypes = await getIssueTypes(validated.projectKey); log.info(`Found ${issueTypes.length} issue type(s)`); return formatIssueTypesResponse(issueTypes); } catch (error) { log.error('Error in handleGetIssueTypes:', error); return handleError(error); } } - src/types/tools.ts:132-138 (schema)Zod validation schema for the tool input, defining optional projectKey with validation.
export const GetIssueTypesInputSchema = z.object({ projectKey: z .string() .optional() .describe('Project key to get issue types for specific project') .refine((v) => (v ? isValidProjectKey(v) : true), 'Invalid project key format'), }); - src/index.ts:32-49 (registration)Registration of all tool handlers in a Map, including the mapping of 'jira_get_issue_types' to handleGetIssueTypes.
const toolHandlers = new Map<string, (input: unknown) => Promise<any>>([ [TOOL_NAMES.GET_VISIBLE_PROJECTS, tools.handleGetVisibleProjects], [TOOL_NAMES.GET_ISSUE, tools.handleGetIssue], [TOOL_NAMES.SEARCH_ISSUES, tools.handleSearchIssues], [TOOL_NAMES.GET_MY_ISSUES, tools.handleGetMyIssues], [TOOL_NAMES.GET_ISSUE_TYPES, tools.handleGetIssueTypes], [TOOL_NAMES.GET_USERS, tools.handleGetUsers], [TOOL_NAMES.GET_PRIORITIES, tools.handleGetPriorities], [TOOL_NAMES.GET_STATUSES, tools.handleGetStatuses], [TOOL_NAMES.CREATE_ISSUE, tools.handleCreateIssue], [TOOL_NAMES.UPDATE_ISSUE, tools.handleUpdateIssue], [TOOL_NAMES.ADD_COMMENT, tools.handleAddComment], [TOOL_NAMES.GET_PROJECT_INFO, tools.handleGetProjectInfo], [TOOL_NAMES.CREATE_SUBTASK, tools.handleCreateSubtask], [TOOL_NAMES.GET_CREATE_META, tools.handleGetCreateMeta], [TOOL_NAMES.GET_CUSTOM_FIELDS, tools.handleGetCustomFields], [TOOL_NAMES.CREATE_ISSUE_LINK, tools.handleCreateIssueLink], ]); - src/index.ts:52-69 (registration)Registration of all tool definitions (with schemas) in the allTools array, including getIssueTypesTool for listing tools.
const allTools = [ tools.getVisibleProjectsTool, tools.getIssueTool, tools.searchIssuesTool, tools.getMyIssuesTool, tools.getIssueTypesTool, tools.getUsersTool, tools.getPrioritiesTool, tools.getStatusesTool, tools.createIssueTool, tools.updateIssueTool, tools.addCommentTool, tools.getProjectInfoTool, tools.createSubtaskTool, tools.getCreateMetaTool, tools.getCustomFieldsTool, tools.createIssueLinkTool, ]; - src/config/constants.ts:29-29 (helper)Constant definition for the tool name 'jira_get_issue_types' used in tool definition and registration.
GET_ISSUE_TYPES: 'jira_get_issue_types',