pylon_delete_contact
Remove a contact from the Pylon customer support platform by specifying its unique ID to manage your contact database.
Instructions
Delete a contact
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The contact ID to delete |
Implementation Reference
- src/index.ts:245-257 (registration)Registration of the 'pylon_delete_contact' MCP tool. Includes input schema (id: string), description, and inline handler function that invokes PylonClient.deleteContact(id) and formats the response as text.server.tool( 'pylon_delete_contact', 'Delete a contact', { id: z.string().describe('The contact ID to delete'), }, async ({ id }) => { const result = await client.deleteContact(id); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; }, );
- src/index.ts:248-250 (schema)Zod input schema for pylon_delete_contact tool requiring a contact 'id'.{ id: z.string().describe('The contact ID to delete'), },
- src/pylon-client.ts:248-255 (handler)Core handler logic in PylonClient: performs DELETE request to /contacts/{id} API endpoint.async deleteContact( id: string, ): Promise<SingleResponse<{ success: boolean }>> { return this.request<SingleResponse<{ success: boolean }>>( 'DELETE', `/contacts/${id}`, ); }
- src/pylon-client.ts:121-147 (helper)Private request method used by deleteContact to make authenticated HTTP requests to Pylon API.private async request<T>( method: string, path: string, body?: object, ): Promise<T> { const url = `${PYLON_API_BASE}${path}`; const headers: Record<string, string> = { Authorization: `Bearer ${this.apiToken}`, 'Content-Type': 'application/json', Accept: 'application/json', }; const response = await fetch(url, { method, headers, body: body ? JSON.stringify(body) : undefined, }); if (!response.ok) { const errorText = await response.text(); throw new Error( `Pylon API error: ${response.status} ${response.statusText} - ${errorText}`, ); } return response.json() as Promise<T>; }