ninja_create_ticket
Create a support ticket by providing client, ticket form, subject, status, and requester. Optionally add location, device, technician, description, type, severity, priority, tags, or parent ticket.
Instructions
Create a new support ticket. Use ninja_list_ticket_forms to find ticketFormId and ninja_list_ticket_statuses for valid status values.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| clientId | Yes | Organization (client) ID | |
| ticketFormId | Yes | Ticket form ID | |
| subject | Yes | Ticket subject line | |
| requesterUid | Yes | UUID of the contact or user requesting the ticket | |
| status | Yes | Status ID (use ninja_list_ticket_statuses; default "1000" = Open) | |
| locationId | No | Location ID to associate | |
| nodeId | No | Device ID to associate | |
| description | No | Ticket body content | |
| type | No | Ticket type | |
| severity | No | Ticket severity | |
| priority | No | Ticket priority | |
| assignedAppUserId | No | Technician user ID to assign | |
| tags | No | Ticket tags | |
| parentTicketId | No | Parent ticket ID (for sub-tickets) |
Implementation Reference
- src/tools/ticketing.ts:51-51 (handler)The handler function that executes the tool logic by making a POST request to /ticketing/ticket with the provided arguments.
handler: async (args, client: NinjaOneClient) => client.post('/ticketing/ticket', args), - src/tools/ticketing.ts:10-49 (schema)The inputSchema defining validation rules and required parameters for ninja_create_ticket: clientId, ticketFormId, subject, status, requesterUid are required; optional fields include locationId, nodeId, description, type, severity, priority, assignedAppUserId, tags, parentTicketId.
inputSchema: { type: 'object', required: ['clientId', 'ticketFormId', 'subject', 'status', 'requesterUid'], properties: { clientId: { type: 'number', description: 'Organization (client) ID' }, ticketFormId: { type: 'number', description: 'Ticket form ID' }, subject: { type: 'string', maxLength: 200, description: 'Ticket subject line' }, requesterUid: { type: 'string', description: 'UUID of the contact or user requesting the ticket' }, status: { type: 'string', description: 'Status ID (use ninja_list_ticket_statuses; default "1000" = Open)' }, locationId: { type: 'number', description: 'Location ID to associate' }, nodeId: { type: 'number', description: 'Device ID to associate' }, description: { type: 'object', description: 'Ticket body content', properties: { public: { type: 'boolean', description: 'Whether visible to end users' }, body: { type: 'string', description: 'Plain text body' }, htmlBody: { type: 'string', description: 'HTML body (use instead of body for rich text)' }, }, }, type: { type: 'string', enum: ['PROBLEM', 'QUESTION', 'INCIDENT', 'TASK', 'CHANGE_REQUEST', 'SERVICE_REQUEST', 'PROJECT', 'APPOINTMENT', 'MISCELLANEOUS'], description: 'Ticket type', }, severity: { type: 'string', enum: ['NONE', 'MINOR', 'MODERATE', 'MAJOR', 'CRITICAL'], description: 'Ticket severity', }, priority: { type: 'string', enum: ['NONE', 'LOW', 'MEDIUM', 'HIGH'], description: 'Ticket priority', }, assignedAppUserId: { type: 'number', description: 'Technician user ID to assign' }, tags: { type: 'array', items: { type: 'string' }, description: 'Ticket tags' }, parentTicketId: { type: 'number', description: 'Parent ticket ID (for sub-tickets)' }, }, }, - src/tools/ticketing.ts:6-52 (registration)The tool definition is part of the ticketingTools array exported from src/tools/ticketing.ts. This array is then spread into ALL_TOOLS in src/tools/index.ts (line 18), which is presumably registered with the MCP server.
{ tool: { name: 'ninja_create_ticket', description: 'Create a new support ticket. Use ninja_list_ticket_forms to find ticketFormId and ninja_list_ticket_statuses for valid status values.', inputSchema: { type: 'object', required: ['clientId', 'ticketFormId', 'subject', 'status', 'requesterUid'], properties: { clientId: { type: 'number', description: 'Organization (client) ID' }, ticketFormId: { type: 'number', description: 'Ticket form ID' }, subject: { type: 'string', maxLength: 200, description: 'Ticket subject line' }, requesterUid: { type: 'string', description: 'UUID of the contact or user requesting the ticket' }, status: { type: 'string', description: 'Status ID (use ninja_list_ticket_statuses; default "1000" = Open)' }, locationId: { type: 'number', description: 'Location ID to associate' }, nodeId: { type: 'number', description: 'Device ID to associate' }, description: { type: 'object', description: 'Ticket body content', properties: { public: { type: 'boolean', description: 'Whether visible to end users' }, body: { type: 'string', description: 'Plain text body' }, htmlBody: { type: 'string', description: 'HTML body (use instead of body for rich text)' }, }, }, type: { type: 'string', enum: ['PROBLEM', 'QUESTION', 'INCIDENT', 'TASK', 'CHANGE_REQUEST', 'SERVICE_REQUEST', 'PROJECT', 'APPOINTMENT', 'MISCELLANEOUS'], description: 'Ticket type', }, severity: { type: 'string', enum: ['NONE', 'MINOR', 'MODERATE', 'MAJOR', 'CRITICAL'], description: 'Ticket severity', }, priority: { type: 'string', enum: ['NONE', 'LOW', 'MEDIUM', 'HIGH'], description: 'Ticket priority', }, assignedAppUserId: { type: 'number', description: 'Technician user ID to assign' }, tags: { type: 'array', items: { type: 'string' }, description: 'Ticket tags' }, parentTicketId: { type: 'number', description: 'Parent ticket ID (for sub-tickets)' }, }, }, }, handler: async (args, client: NinjaOneClient) => client.post('/ticketing/ticket', args), }, - src/tools/ticketing.ts:1-8 (helper)Imports used: NinjaOneClient (HTTP client performing the POST request), clean (utility for cleaning params), and ToolDef (type interface defining tool shape with tool and handler properties).
import { NinjaOneClient } from '../client.js'; import { clean } from '../utils.js'; import { ToolDef } from './types.js'; export const ticketingTools: ToolDef[] = [ { tool: { name: 'ninja_create_ticket',