Skip to main content
Glama

jira_get_statuses

Read-only

Retrieve available issue statuses globally or per project, including categories and workflow details, by providing project key or issue type ID.

Instructions

Retrieves available statuses (global or project-specific, e.g., To Do, In Progress, Done). Returns status categories and workflow information.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectKeyNoProject key to get statuses for specific project
issueTypeIdNoIssue type ID to get statuses for specific issue type

Implementation Reference

  • The main handler function handleGetStatuses that validates input, calls the API helper, and formats the response.
    export async function handleGetStatuses(input: unknown): Promise<McpToolResponse> {
      try {
        const validated = validateInput(GetStatusesInputSchema, input);
    
        if (validated.projectKey && validated.issueTypeId) {
          log.info(
            `Getting statuses for project ${validated.projectKey} and issue type ${validated.issueTypeId}...`
          );
        } else if (validated.projectKey) {
          log.info(`Getting statuses for project ${validated.projectKey}...`);
        } else {
          log.info('Getting global statuses...');
        }
    
        const getParams: any = {};
    
        if (validated.projectKey !== undefined) getParams.projectKey = validated.projectKey;
        if (validated.issueTypeId !== undefined) getParams.issueTypeId = validated.issueTypeId;
    
        const statuses = await getStatuses(getParams);
    
        log.info(`Found ${statuses.length} status(es)`);
    
        return formatStatusesResponse(statuses);
      } catch (error) {
        log.error('Error in handleGetStatuses:', error);
        return handleError(error);
      }
    }
  • Zod schema GetStatusesInputSchema defining optional projectKey and issueTypeId input parameters.
    export const GetStatusesInputSchema = z.object({
      projectKey: z
        .string()
        .optional()
        .describe('Project key to get statuses for specific project')
        .refine((v) => (v ? isValidProjectKey(v) : true), 'Invalid project key format'),
      issueTypeId: z
        .string()
        .optional()
        .describe('Issue type ID to get statuses for specific issue type'),
    });
    
    export type GetStatusesInput = z.infer<typeof GetStatusesInputSchema>;
  • src/index.ts:115-121 (registration)
    Registration of the tool in the MCP server with name, schema, handler, and readOnlyHint annotation.
    {
      name: TOOL_NAMES.GET_STATUSES,
      description: tools.getStatusesTool.description!,
      inputSchema: GetStatusesInputSchema,
      handler: tools.handleGetStatuses,
      annotations: { readOnlyHint: true },
    },
  • The API helper function getStatuses that fetches statuses from Jira API, supporting project-level and global queries.
    export async function getStatuses(
      options: {
        projectKey?: string;
        issueTypeId?: string;
      } = {}
    ): Promise<JiraStatus[]> {
      let url = '/status';
    
      if (options.projectKey && options.issueTypeId) {
        url = `/project/${options.projectKey}/statuses`;
      } else if (options.projectKey) {
        url = `/project/${options.projectKey}/statuses`;
      }
    
      const config: AxiosRequestConfig = {
        method: 'GET',
        url,
      };
    
      if (options.projectKey) {
        const response =
          await makeJiraRequest<Array<{ id?: string; name: string; statuses: JiraStatus[] }>>(config);
        if (options.issueTypeId) {
          const match = response.find(
            (issueType) =>
              issueType.id === options.issueTypeId || issueType.name === options.issueTypeId
          );
          if (match) return match.statuses;
        }
        // Flatten the statuses from all issue types
        return response.flatMap((issueType) => issueType.statuses);
      }
      return await makeJiraRequest<JiraStatus[]>(config);
    }
  • The formatter function formatStatusesResponse that formats Jira status data into a human-readable text response.
    export function formatStatusesResponse(statuses: JiraStatus[]): McpToolResponse {
      if (statuses.length === 0) {
        return {
          content: [
            {
              type: 'text',
              text: 'No statuses found.',
            },
          ],
        };
      }
    
      const statusesList = statuses
        .map(
          (status) =>
            `• **${status.name}** (ID: ${status.id})\n  ${status.description}\n  Category: ${status.statusCategory.name} (${status.statusCategory.key})`
        )
        .join('\n\n');
    
      return {
        content: [
          {
            type: 'text',
            text: `Found ${statuses.length} status(es):\n\n${statusesList}`,
          },
        ],
      };
    }
Behavior3/5

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

Annotations already declare readOnlyHint=true, so the description is not required to state it is safe. It adds context about returning categories and workflow info, which is helpful but not extensive. No contradictions with annotations.

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 sentence, front-loaded with the purpose, and contains no wasted words. It is appropriately concise and well-structured.

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

Completeness4/5

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

Given no output schema, the description explains what is returned (statuses, categories, workflow info). It is mostly complete for a simple retrieval tool, though could be more precise about the return format (e.g., array of objects).

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 coverage is 100%, so the schema already describes the parameters. The description does not add extra meaning beyond implying global vs project-specific use. Baseline of 3 is appropriate since the description adds minimal value over the schema.

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 tool retrieves available statuses, provides examples (To Do, In Progress, Done), and notes it returns status categories and workflow information. It is specific enough but does not explicitly differentiate from sibling tools like jira_get_issue_types or jira_get_priorities.

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 mentions global or project-specific context but gives no guidance on when to use this tool over alternatives such as jira_get_transitions or jira_get_issue_types. No explicit when-to-use or when-not-to-use information is provided.

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

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