pylon_update_contact
Update an existing contact's name, email, account, avatar, or portal role by providing the contact ID and fields to change.
Instructions
Update an existing contact
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The contact ID | |
| name | No | Updated name | |
| No | Updated email | ||
| account_id | No | Updated account association | |
| avatar_url | No | Updated avatar URL | |
| portal_role | No | Updated portal role |
Implementation Reference
- src/index.ts:465-485 (registration)Registration of the 'pylon_update_contact' tool on the MCP server with its name, description, input schema (id required; name, email, account_id, avatar_url, portal_role optional), and handler implementation that calls client.updateContact.
server.tool( 'pylon_update_contact', 'Update an existing contact', { id: z.string().describe('The contact ID'), name: z.string().optional().describe('Updated name'), email: z.string().optional().describe('Updated email'), account_id: z.string().optional().describe('Updated account association'), avatar_url: z.string().optional().describe('Updated avatar URL'), portal_role: z .enum(['no_access', 'member', 'admin']) .optional() .describe('Updated portal role'), }, async ({ id, ...data }) => { const result = await client.updateContact(id, data); return { content: [{ type: 'text', text: JSON.stringify(result.data, null, 2) }], }; }, ); - src/index.ts:479-484 (handler)Handler implementation for pylon_update_contact. Destructures id from params, passes remaining data to client.updateContact, then returns the result as formatted JSON text content.
async ({ id, ...data }) => { const result = await client.updateContact(id, data); return { content: [{ type: 'text', text: JSON.stringify(result.data, null, 2) }], }; }, - src/index.ts:468-478 (schema)Input schema for pylon_update_contact using Zod. Requires 'id' (string), and optionally accepts 'name', 'email', 'account_id', 'avatar_url' (strings), and 'portal_role' (enum: 'no_access', 'member', 'admin').
{ id: z.string().describe('The contact ID'), name: z.string().optional().describe('Updated name'), email: z.string().optional().describe('Updated email'), account_id: z.string().optional().describe('Updated account association'), avatar_url: z.string().optional().describe('Updated avatar URL'), portal_role: z .enum(['no_access', 'member', 'admin']) .optional() .describe('Updated portal role'), }, - src/pylon-client.ts:391-400 (helper)The PylonClient.updateContact method that performs the actual API call. Sends a PATCH request to /contacts/{id} with the partial contact data, returning a SingleResponse<Contact>.
async updateContact( id: string, data: Partial<Contact>, ): Promise<SingleResponse<Contact>> { return this.request<SingleResponse<Contact>>( 'PATCH', `/contacts/${id}`, data, ); }