Skip to main content
Glama
KS-GEN-AI

Jira MCP Server

by KS-GEN-AI

delete_ticket

Remove a Jira issue permanently by specifying its ID or key to clean up resolved or obsolete tickets.

Instructions

Delete a ticket on Jira on the api /rest/api/3/issue/{issueIdOrKey}. Do not use markdown in your query.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
issueIdOrKeyYesThe issue id or key

Implementation Reference

  • Core handler function that executes the DELETE request to the Jira API to delete the ticket specified by issueIdOrKey.
    async function deleteTicket(issueIdOrKey: string): Promise<any> {
      try {
        const response = await axios.delete(
          `${JIRA_URL}/rest/api/3/issue/${issueIdOrKey}`,
          {
            headers: getAuthHeaders().headers,
          },
        );
        return response.data;
      } catch (error: any) {
        return {
          error: error.response.data,
        };
      }
    }
  • src/index.ts:142-155 (registration)
    Registers the 'delete_ticket' tool in the list of available tools, including its description and input schema.
      name: 'delete_ticket',
      description:
        'Delete a ticket on Jira on the api /rest/api/3/issue/{issueIdOrKey}. Do not use markdown in your query.',
      inputSchema: {
        type: 'object',
        properties: {
          issueIdOrKey: {
            type: 'string',
            description: 'The issue id or key',
          },
        },
        required: ['issueIdOrKey'],
      },
    },
  • Dispatch handler in the CallToolRequestHandler that handles calls to 'delete_ticket', validates input, invokes deleteTicket, and formats the response.
    case 'delete_ticket': {
      const issueIdOrKey: any = request.params.arguments?.issueIdOrKey;
    
      if (!issueIdOrKey) {
        throw new Error('Issue id or key is required');
      }
    
      const response = await deleteTicket(issueIdOrKey);
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(response, null, 2),
          },
        ],
      };
    }
  • Input schema definition for the delete_ticket tool, specifying the required 'issueIdOrKey' parameter.
    inputSchema: {
      type: 'object',
      properties: {
        issueIdOrKey: {
          type: 'string',
          description: 'The issue id or key',
        },
      },
      required: ['issueIdOrKey'],
    },

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/KS-GEN-AI/jira-mcp-server'

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