pylon_search_contacts
Search contacts in Pylon customer support platform using filters like ID, email, or account ID to find specific customer records.
Instructions
Search contacts with filters
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filter | Yes | Filter object with fields like id, email, account_id. Supports operators: equals, in, not_in, string_contains | |
| limit | No | Results limit | |
| cursor | No | Pagination cursor |
Implementation Reference
- src/index.ts:259-282 (registration)Registers the MCP tool 'pylon_search_contacts' with Zod input schema (filter, limit, cursor) and handler function that invokes PylonClient.searchContacts and formats the response as text.server.tool( 'pylon_search_contacts', 'Search contacts with filters', { filter: z .object({ id: z.object({}).optional(), email: z.object({}).optional(), account_id: z.object({}).optional(), }) .passthrough() .describe( 'Filter object with fields like id, email, account_id. Supports operators: equals, in, not_in, string_contains', ), limit: z.number().min(1).max(1000).optional().describe('Results limit'), cursor: z.string().optional().describe('Pagination cursor'), }, async ({ filter, limit, cursor }) => { const result = await client.searchContacts(filter, { limit, cursor }); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; }, );
- src/index.ts:276-281 (handler)The execution handler for the tool, which calls the PylonClient's searchContacts method and returns the result as a JSON-formatted text content block.async ({ filter, limit, cursor }) => { const result = await client.searchContacts(filter, { limit, cursor }); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; },
- src/index.ts:262-275 (schema)Zod schema defining the input parameters: filter (object with optional id/email/account_id), limit (1-1000), cursor (string).{ filter: z .object({ id: z.object({}).optional(), email: z.object({}).optional(), account_id: z.object({}).optional(), }) .passthrough() .describe( 'Filter object with fields like id, email, account_id. Supports operators: equals, in, not_in, string_contains', ), limit: z.number().min(1).max(1000).optional().describe('Results limit'), cursor: z.string().optional().describe('Pagination cursor'), },
- src/pylon-client.ts:257-270 (helper)PylonClient helper method that performs the actual API request (POST /contacts/search) with filter, limit, and cursor parameters.async searchContacts( filter: object, params?: PaginationParams, ): Promise<PaginatedResponse<Contact>> { return this.request<PaginatedResponse<Contact>>( 'POST', '/contacts/search', { filter, limit: params?.limit, cursor: params?.cursor, }, ); }