Skip to main content
Glama

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
NameRequiredDescriptionDefault
projectKeyNoProject key to get issue types for specific project (optional - if not provided, returns global issue types)

Implementation Reference

  • 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);
      }
    }
  • 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,
    ];
  • Constant definition for the tool name 'jira_get_issue_types' used in tool definition and registration.
    GET_ISSUE_TYPES: 'jira_get_issue_types',

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

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