ninja_add_ticket_comment
Add a plain text or HTML comment to a ticket, with options for public visibility and time tracking.
Instructions
Add a comment to a ticket.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ticketId | Yes | Ticket ID | |
| body | Yes | Comment body (plain text) | |
| htmlBody | No | Comment body as HTML | |
| public | No | Whether the comment is public (visible to end users) | |
| timeTracked | No | Time tracked in seconds | |
| technicianUid | No | UID of the technician adding the comment |
Implementation Reference
- src/tools/ticketing.ts:98-116 (schema)Tool definition and input schema for 'ninja_add_ticket_comment'. Defines name, description, and inputSchema with required fields: ticketId (number) and body (string), plus optional fields: htmlBody, public, timeTracked, technicianUid.
tool: { name: 'ninja_add_ticket_comment', description: 'Add a comment to a ticket.', inputSchema: { type: 'object', required: ['ticketId', 'body'], properties: { ticketId: { type: 'number', description: 'Ticket ID' }, body: { type: 'string', description: 'Comment body (plain text)' }, htmlBody: { type: 'string', description: 'Comment body as HTML' }, public: { type: 'boolean', description: 'Whether the comment is public (visible to end users)', }, timeTracked: { type: 'number', description: 'Time tracked in seconds' }, technicianUid: { type: 'string', description: 'UID of the technician adding the comment' }, }, }, }, - src/tools/ticketing.ts:117-119 (handler)Handler function for 'ninja_add_ticket_comment'. Extracts ticketId from args, passes remaining body fields to a POST request to /ticketing/ticket/{ticketId}/comment via the NinjaOneClient.
handler: async ({ ticketId, ...body }, client: NinjaOneClient) => client.post(`/ticketing/ticket/${ticketId}/comment`, body), }, - src/tools/ticketing.ts:5-5 (registration)The tool is registered as part of the ticketingTools array exported from this module, which is then spread into the ALL_TOOLS array in src/tools/index.ts.
export const ticketingTools: ToolDef[] = [