Skip to main content
Glama

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
NameRequiredDescriptionDefault
idYesThe 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) }],
    		};
    	},
    );
  • Zod input schema for pylon_delete_contact tool requiring a contact 'id'.
    {
    	id: z.string().describe('The contact ID to delete'),
    },
  • 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}`,
    	);
    }
  • 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>;
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/JustinBeckwith/pylon-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server