delete_ticket
Remove a ticket from the mcptix MCP server by specifying its ID. This tool helps streamline ticket management within AI-assisted project tracking systems.
Instructions
Delete a ticket
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Ticket ID |
Input Schema (JSON Schema)
{
"properties": {
"id": {
"description": "Ticket ID",
"type": "string"
}
},
"required": [
"id"
],
"type": "object"
}
Implementation Reference
- The main handler function that executes the 'delete_ticket' tool. It validates the input, checks if the ticket exists, deletes it using the database queries, and returns a success response.export function handleDeleteTicket(ticketQueries: TicketQueries, args: any): ToolResponse { if (!args.id) { throw new Error('Ticket ID is required'); } // Check if ticket exists const existingTicket = ticketQueries.getTicketById(args.id); if (!existingTicket) { throw new Error(`Ticket with ID ${args.id} not found`); } // Delete ticket const success = ticketQueries.deleteTicket(args.id); return createSuccessResponse({ id: args.id, success }); }
- src/mcp/tools/schemas.ts:177-190 (schema)The input schema definition for the 'delete_ticket' tool, specifying that a ticket ID is required.{ name: 'delete_ticket', description: 'Delete a ticket', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Ticket ID', }, }, required: ['id'], }, },
- src/mcp/tools/setup.ts:46-47 (registration)The registration of the 'delete_ticket' tool in the MCP server's request handler switch statement, which routes calls to the handleDeleteTicket function.case 'delete_ticket': return handleDeleteTicket(ticketQueries, args);
- src/mcp/tools/setup.ts:12-12 (registration)The import statement that brings in the delete_ticket handler function for use in the MCP tool setup.import { handleDeleteTicket } from './handlers/delete-ticket';