pylon_create_issue
Create a new support ticket in Pylon to track customer issues with specified title, description, priority, and assignee.
Instructions
Create a new issue/ticket in Pylon
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | Title of the issue | |
| body_html | Yes | HTML content of the issue body | |
| account_id | No | Associated account ID | |
| assignee_id | No | User ID to assign the issue to | |
| contact_id | No | Associated contact ID | |
| requester_id | No | Requester contact ID | |
| tags | No | Tags to apply | |
| priority | No | Issue priority |
Implementation Reference
- src/index.ts:682-707 (registration)Registration of the 'pylon_create_issue' tool via server.tool(), including Zod schema for input validation and the async handler callback.
server.tool( 'pylon_create_issue', 'Create a new issue/ticket in Pylon', { title: z.string().describe('Title of the issue'), body_html: z.string().describe('HTML content of the issue body'), account_id: z.string().optional().describe('Associated account ID'), assignee_id: z .string() .optional() .describe('User ID to assign the issue to'), contact_id: z.string().optional().describe('Associated contact ID'), requester_id: z.string().optional().describe('Requester contact ID'), tags: z.array(z.string()).optional().describe('Tags to apply'), priority: z .enum(['urgent', 'high', 'medium', 'low']) .optional() .describe('Issue priority'), }, async (params) => { const result = await client.createIssue(params); return { content: [{ type: 'text', text: JSON.stringify(result.data, null, 2) }], }; }, ); - src/index.ts:701-707 (handler)Handler function for pylon_create_issue: calls client.createIssue(params) and returns the result data as JSON.
async (params) => { const result = await client.createIssue(params); return { content: [{ type: 'text', text: JSON.stringify(result.data, null, 2) }], }; }, ); - src/index.ts:685-700 (schema)Zod schema defining input parameters: title (required string), body_html (required string), and optional fields account_id, assignee_id, contact_id, requester_id, tags (array of strings), priority (enum).
{ title: z.string().describe('Title of the issue'), body_html: z.string().describe('HTML content of the issue body'), account_id: z.string().optional().describe('Associated account ID'), assignee_id: z .string() .optional() .describe('User ID to assign the issue to'), contact_id: z.string().optional().describe('Associated contact ID'), requester_id: z.string().optional().describe('Requester contact ID'), tags: z.array(z.string()).optional().describe('Tags to apply'), priority: z .enum(['urgent', 'high', 'medium', 'low']) .optional() .describe('Issue priority'), }, - src/pylon-client.ts:449-464 (helper)PylonClient.createIssue() method that sends a POST request to /issues endpoint with the provided data. Accepts title, body_html, and optional fields like account_id, assignee_id, contact_id, requester_id, tags, priority, etc.
async createIssue(data: { title: string; body_html: string; account_id?: string; assignee_id?: string; contact_id?: string; requester_id?: string; user_id?: string; tags?: string[]; attachment_urls?: string[]; custom_fields?: object[]; priority?: 'urgent' | 'high' | 'medium' | 'low'; destination_metadata?: object; }): Promise<SingleResponse<Issue>> { return this.request<SingleResponse<Issue>>('POST', '/issues', data); }