Skip to main content
Glama
kornbed

Jira MCP Server for Cursor

create_ticket

Create new Jira tickets directly from Cursor editor by specifying summary, description, project key, and issue type.

Instructions

Create a new Jira ticket

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ticketYes

Implementation Reference

  • The handler function for the create_ticket tool. It validates the Jira configuration, constructs the issue fields from the input ticket, optionally adds a parent link, creates the issue using the Jira API, and returns a success message with the new ticket key or an error message.
    async ({ ticket }: { ticket: JiraTicket }) => {
      const configError = validateJiraConfig();
      if (configError) {
        return {
          content: [{ type: "text", text: `Configuration error: ${configError}` }],
        };
      }
    
      try {
        const fields: any = {
          project: { key: ticket.projectKey },
          summary: ticket.summary,
          description: ticket.description,
          issuetype: { name: ticket.issueType },
        };
    
        // Add parent/epic link if specified
        if (ticket.parent) {
          fields.parent = { key: ticket.parent };
        }
    
        const newTicket = await jira.issues.createIssue({
          fields: fields,
        });
    
        return {
          content: [{ type: "text", text: `Created ticket: ${newTicket.key}` }],
        };
      } catch (error) {
        return {
          content: [{ type: "text", text: `Failed to create ticket: ${(error as Error).message}` }],
        };
      }
    }
  • Zod schema used to validate the input 'ticket' parameter for the create_ticket tool.
    const TicketSchema = z.object({
      summary: z.string().describe("The ticket summary"),
      description: z.string().describe("The ticket description"),
      projectKey: z.string().describe("The project key (e.g., PROJECT)"),
      issueType: z.string().describe("The type of issue (e.g., Task, Bug)"),
      parent: z.string().optional().describe("The parent/epic key (for next-gen projects)"),
    });
  • src/server.ts:271-311 (registration)
    The MCP server.tool() call that registers the create_ticket tool, specifying its name, description, input schema, and handler function.
    server.tool(
      "create_ticket",
      "Create a new Jira ticket",
      {
        ticket: TicketSchema,
      },
      async ({ ticket }: { ticket: JiraTicket }) => {
        const configError = validateJiraConfig();
        if (configError) {
          return {
            content: [{ type: "text", text: `Configuration error: ${configError}` }],
          };
        }
    
        try {
          const fields: any = {
            project: { key: ticket.projectKey },
            summary: ticket.summary,
            description: ticket.description,
            issuetype: { name: ticket.issueType },
          };
    
          // Add parent/epic link if specified
          if (ticket.parent) {
            fields.parent = { key: ticket.parent };
          }
    
          const newTicket = await jira.issues.createIssue({
            fields: fields,
          });
    
          return {
            content: [{ type: "text", text: `Created ticket: ${newTicket.key}` }],
          };
        } catch (error) {
          return {
            content: [{ type: "text", text: `Failed to create ticket: ${(error as Error).message}` }],
          };
        }
      }
    );
  • TypeScript interface defining the structure of the JiraTicket type used in the create_ticket handler's type annotation.
    interface JiraTicket {
      summary: string;
      description: string;
      projectKey: string;
      issueType: string;
      parent?: string; // Optional parent/epic key for next-gen projects
    }
  • Helper function called by the handler to validate that required Jira environment variables are set before attempting to create a ticket.
    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 the full burden of behavioral disclosure. It states 'Create' which implies a write/mutation operation, but doesn't mention permissions required, whether the operation is idempotent, error handling, or what happens on success (e.g., returns ticket ID). This is inadequate for a mutation tool with zero annotation coverage.

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 states the core function without unnecessary words. It's appropriately sized and front-loaded, making it easy to parse quickly.

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 mutation tool with no annotations, no output schema, and 1 complex nested parameter (5 sub-properties), the description is incomplete. It doesn't cover behavioral aspects like authentication needs, error cases, or return values, nor does it explain parameter usage, making it inadequate for safe and effective tool invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds no parameter information beyond what's in the schema. With 0% schema description coverage (the schema has descriptions but they're not counted in coverage), the description fails to compensate by explaining the 'ticket' object structure, required fields like 'summary' and 'projectKey', or their purposes. This leaves parameters largely undocumented.

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 ('Create') and resource ('new Jira ticket'), making the purpose immediately understandable. It doesn't differentiate from siblings like 'add_comment' or 'update_status', but it's specific enough to understand the core function without being tautological.

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 'update_status' or 'add_comment'. There's no mention of prerequisites, context, or exclusions, leaving the agent to infer usage solely from the tool name and schema.

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