get_ticket
Retrieve specific ticket details by ID using the MCP server mcptix, enabling efficient ticket management and task tracking for AI assistants.
Instructions
Get a ticket by ID
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 handler function that executes the get_ticket tool logic: validates the ticket ID, fetches the ticket using TicketQueries.getTicketById, and returns it wrapped in a success response.export function handleGetTicket(ticketQueries: TicketQueries, args: any): ToolResponse { if (!args.id) { Logger.warn('McpServer', 'Ticket ID is required'); throw new Error('Ticket ID is required'); } Logger.debug('McpServer', `Getting ticket with ID: ${args.id}`); const ticket = ticketQueries.getTicketById(args.id); if (!ticket) { Logger.warn('McpServer', `Ticket with ID ${args.id} not found`); throw new Error(`Ticket with ID ${args.id} not found`); } Logger.debug('McpServer', `Found ticket: ${args.id}`); return createSuccessResponse(ticket); }
- src/mcp/tools/schemas.ts:48-60 (schema)The JSON schema definition for the get_ticket tool, specifying the required 'id' parameter.name: 'get_ticket', description: 'Get a ticket by ID', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Ticket ID', }, }, required: ['id'], }, },
- src/mcp/tools/setup.ts:40-41 (registration)The registration of the get_ticket tool in the MCP CallToolRequestSchema handler switch statement, dispatching to the handleGetTicket function.case 'get_ticket': return handleGetTicket(ticketQueries, args);