tdx-ticket-create
Create new tickets in TeamDynamix for IT service management, specifying type, title, priority, responsible parties, and custom attributes.
Instructions
Create a new TDX ticket
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| appId | No | TDX app ID (defaults to env TDX_APP_ID) | |
| typeId | Yes | Ticket type ID | |
| title | Yes | Ticket title | |
| description | No | Ticket description (HTML) | |
| accountId | No | Account/department ID | |
| priorityId | No | Priority ID | |
| statusId | No | Status ID | |
| requestorUid | No | Requestor person UID | |
| responsibleUid | No | Responsible person UID | |
| responsibleGroupId | No | Responsible group ID | |
| formId | No | Form ID | |
| sourceId | No | Source ID | |
| serviceId | No | Service ID | |
| goesOffHoldDate | No | ISO date when ticket goes off hold | |
| attributes | No | Custom attributes |
Implementation Reference
- src/tools/tickets.ts:31-57 (handler)The handler for tdx-ticket-create which prepares the request body and calls the TDX client.
async (params) => { const app = params.appId ?? defaultAppId; const body: Record<string, unknown> = { TypeID: params.typeId, Title: params.title, }; if (params.description !== undefined) body.Description = params.description; if (params.accountId !== undefined) body.AccountID = params.accountId; if (params.priorityId !== undefined) body.PriorityID = params.priorityId; if (params.statusId !== undefined) body.StatusID = params.statusId; if (params.requestorUid !== undefined) body.RequestorUid = params.requestorUid; if (params.responsibleUid !== undefined) body.ResponsibleUid = params.responsibleUid; if (params.responsibleGroupId !== undefined) body.ResponsibleGroupID = params.responsibleGroupId; if (params.formId !== undefined) body.FormID = params.formId; if (params.sourceId !== undefined) body.SourceID = params.sourceId; if (params.serviceId !== undefined) body.ServiceID = params.serviceId; if (params.goesOffHoldDate !== undefined) body.GoesOffHoldDate = params.goesOffHoldDate; if (params.attributes) { body.Attributes = params.attributes.map((a) => ({ ID: a.id, Value: String(a.value) })); } try { const result = await client.post(`/${app}/tickets`, body); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } catch (e: unknown) { return { content: [{ type: "text", text: String(e) }], isError: true }; } } - src/tools/tickets.ts:11-30 (schema)The Zod schema definition for the input parameters of tdx-ticket-create.
{ appId: z.number().optional().describe("TDX app ID (defaults to env TDX_APP_ID)"), typeId: z.number().describe("Ticket type ID"), title: z.string().describe("Ticket title"), description: z.string().optional().describe("Ticket description (HTML)"), accountId: z.number().optional().describe("Account/department ID"), priorityId: z.number().optional().describe("Priority ID"), statusId: z.number().optional().describe("Status ID"), requestorUid: z.string().optional().describe("Requestor person UID"), responsibleUid: z.string().optional().describe("Responsible person UID"), responsibleGroupId: z.number().optional().describe("Responsible group ID"), formId: z.number().optional().describe("Form ID"), sourceId: z.number().optional().describe("Source ID"), serviceId: z.number().optional().describe("Service ID"), goesOffHoldDate: z.string().optional().describe("ISO date when ticket goes off hold"), attributes: z.array(z.object({ id: z.number().describe("Custom attribute ID"), value: z.union([z.string(), z.number(), z.boolean()]).describe("Attribute value"), })).optional().describe("Custom attributes"), }, - src/tools/tickets.ts:8-58 (registration)Registration of the tdx-ticket-create tool on the MCP server.
server.tool( "tdx-ticket-create", "Create a new TDX ticket", { appId: z.number().optional().describe("TDX app ID (defaults to env TDX_APP_ID)"), typeId: z.number().describe("Ticket type ID"), title: z.string().describe("Ticket title"), description: z.string().optional().describe("Ticket description (HTML)"), accountId: z.number().optional().describe("Account/department ID"), priorityId: z.number().optional().describe("Priority ID"), statusId: z.number().optional().describe("Status ID"), requestorUid: z.string().optional().describe("Requestor person UID"), responsibleUid: z.string().optional().describe("Responsible person UID"), responsibleGroupId: z.number().optional().describe("Responsible group ID"), formId: z.number().optional().describe("Form ID"), sourceId: z.number().optional().describe("Source ID"), serviceId: z.number().optional().describe("Service ID"), goesOffHoldDate: z.string().optional().describe("ISO date when ticket goes off hold"), attributes: z.array(z.object({ id: z.number().describe("Custom attribute ID"), value: z.union([z.string(), z.number(), z.boolean()]).describe("Attribute value"), })).optional().describe("Custom attributes"), }, async (params) => { const app = params.appId ?? defaultAppId; const body: Record<string, unknown> = { TypeID: params.typeId, Title: params.title, }; if (params.description !== undefined) body.Description = params.description; if (params.accountId !== undefined) body.AccountID = params.accountId; if (params.priorityId !== undefined) body.PriorityID = params.priorityId; if (params.statusId !== undefined) body.StatusID = params.statusId; if (params.requestorUid !== undefined) body.RequestorUid = params.requestorUid; if (params.responsibleUid !== undefined) body.ResponsibleUid = params.responsibleUid; if (params.responsibleGroupId !== undefined) body.ResponsibleGroupID = params.responsibleGroupId; if (params.formId !== undefined) body.FormID = params.formId; if (params.sourceId !== undefined) body.SourceID = params.sourceId; if (params.serviceId !== undefined) body.ServiceID = params.serviceId; if (params.goesOffHoldDate !== undefined) body.GoesOffHoldDate = params.goesOffHoldDate; if (params.attributes) { body.Attributes = params.attributes.map((a) => ({ ID: a.id, Value: String(a.value) })); } try { const result = await client.post(`/${app}/tickets`, body); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } catch (e: unknown) { return { content: [{ type: "text", text: String(e) }], isError: true }; } } );