pylon_create_contact
Add new contacts to your Pylon customer support platform by providing name, email, account association, and access permissions.
Instructions
Create a new contact in Pylon
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | The name of the contact | |
| No | Email address of the contact | ||
| account_id | No | ID of the account to associate with | |
| avatar_url | No | URL of the contact avatar | |
| portal_role | No | Portal access role |
Implementation Reference
- src/index.ts:199-221 (registration)Registration of the 'pylon_create_contact' MCP tool using server.tool(), including description, Zod input schema, and thin handler wrapper.server.tool( 'pylon_create_contact', 'Create a new contact in Pylon', { name: z.string().describe('The name of the contact'), email: z.string().optional().describe('Email address of the contact'), account_id: z .string() .optional() .describe('ID of the account to associate with'), avatar_url: z.string().optional().describe('URL of the contact avatar'), portal_role: z .enum(['no_access', 'member', 'admin']) .optional() .describe('Portal access role'), }, async (params) => { const result = await client.createContact(params); return { content: [{ type: 'text', text: JSON.stringify(result.data, null, 2) }], }; }, );
- src/index.ts:202-214 (schema)Zod schema defining the input parameters for the pylon_create_contact tool.{ name: z.string().describe('The name of the contact'), email: z.string().optional().describe('Email address of the contact'), account_id: z .string() .optional() .describe('ID of the account to associate with'), avatar_url: z.string().optional().describe('URL of the contact avatar'), portal_role: z .enum(['no_access', 'member', 'admin']) .optional() .describe('Portal access role'), },
- src/index.ts:215-220 (handler)MCP tool handler that invokes PylonClient.createContact and returns formatted JSON response.async (params) => { const result = await client.createContact(params); return { content: [{ type: 'text', text: JSON.stringify(result.data, null, 2) }], }; },
- src/pylon-client.ts:231-235 (helper)PylonClient method implementing the core API call to create a contact via POST /contacts.async createContact( data: Partial<Contact> & { name: string }, ): Promise<SingleResponse<Contact>> { return this.request<SingleResponse<Contact>>('POST', '/contacts', data); }