Skip to main content
Glama
kornbed

Jira MCP Server for Cursor

list_tickets

Retrieve Jira tickets assigned to you using optional JQL queries to filter results directly within your editor.

Instructions

List Jira tickets assigned to you

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
jqlNoOptional JQL query to filter tickets

Implementation Reference

  • The handler function for the 'list_tickets' tool. It validates Jira configuration, executes a JQL query (defaulting to tickets assigned to current user), fetches issues via Jira API, formats them as key: summary (status), and returns as text content.
    async ({ jql }: { jql?: string }) => {
      const configError = validateJiraConfig();
      if (configError) {
        return {
          content: [{ type: "text", text: `Configuration error: ${configError}` }],
        };
      }
    
      try {
        const query = jql || 'assignee = currentUser() ORDER BY updated DESC';
        const tickets = await jira.issueSearch.searchForIssuesUsingJql({ jql: query });
        
        if (!tickets.issues || tickets.issues.length === 0) {
          return {
            content: [{ type: "text", text: "No tickets found" }],
          };
        }
    
        const formattedTickets = tickets.issues.map((issue) => {
          const summary = issue.fields?.summary || 'No summary';
          const status = issue.fields?.status?.name || 'Unknown status';
          return `${issue.key}: ${summary} (${status})`;
        }).join('\n');
    
        return {
          content: [{ type: "text", text: formattedTickets }],
        };
      } catch (error) {
        return {
          content: [{ type: "text", text: `Failed to fetch tickets: ${(error as Error).message}` }],
        };
      }
    }
  • Input schema for the 'list_tickets' tool, defining an optional 'jql' parameter using Zod for validation.
      jql: z.string().optional().describe("Optional JQL query to filter tickets"),
    },
  • src/server.ts:118-157 (registration)
    Registration of the 'list_tickets' tool on the MCP server, including name, description, input schema, and handler function.
    server.tool(
      "list_tickets",
      "List Jira tickets assigned to you",
      {
        jql: z.string().optional().describe("Optional JQL query to filter tickets"),
      },
      async ({ jql }: { jql?: string }) => {
        const configError = validateJiraConfig();
        if (configError) {
          return {
            content: [{ type: "text", text: `Configuration error: ${configError}` }],
          };
        }
    
        try {
          const query = jql || 'assignee = currentUser() ORDER BY updated DESC';
          const tickets = await jira.issueSearch.searchForIssuesUsingJql({ jql: query });
          
          if (!tickets.issues || tickets.issues.length === 0) {
            return {
              content: [{ type: "text", text: "No tickets found" }],
            };
          }
    
          const formattedTickets = tickets.issues.map((issue) => {
            const summary = issue.fields?.summary || 'No summary';
            const status = issue.fields?.status?.name || 'Unknown status';
            return `${issue.key}: ${summary} (${status})`;
          }).join('\n');
    
          return {
            content: [{ type: "text", text: formattedTickets }],
          };
        } catch (error) {
          return {
            content: [{ type: "text", text: `Failed to fetch tickets: ${(error as Error).message}` }],
          };
        }
      }
    );
  • Helper function to validate Jira configuration environment variables, called at the start of the list_tickets handler.
    function validateJiraConfig(): string | null {
      if (!process.env.JIRA_HOST) return "JIRA_HOST environment variable is not set";
      if (!process.env.JIRA_EMAIL) return "JIRA_EMAIL environment variable is not set";
      if (!process.env.JIRA_API_TOKEN) return "JIRA_API_TOKEN environment variable is not set";
      return null;
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states it's a list operation but doesn't mention pagination, rate limits, authentication requirements, or what happens if no tickets are assigned. For a tool with zero annotation coverage, this leaves significant behavioral gaps.

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 communicates the core functionality without any wasted words. It's appropriately sized for a simple list tool and front-loads the essential information.

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?

For a tool with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what the return format looks like, how results are structured, or any behavioral constraints. Given the lack of structured data, more context about the operation would be needed.

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 optional 'jql' parameter. The description doesn't add any parameter-specific information beyond what's in the schema, maintaining the baseline score of 3 when schema does the heavy lifting.

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 action ('List') and resource ('Jira tickets assigned to you'), making the purpose immediately understandable. It doesn't explicitly distinguish from siblings like 'search_tickets' or 'get_ticket', but the focus on 'assigned to you' provides some implicit differentiation.

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_tickets' or 'get_ticket'. It mentions 'assigned to you' but doesn't clarify if this is a default filter or the only available scope, leaving usage context ambiguous.

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

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