pylon_list_contacts
Retrieve and manage contact lists from Pylon customer support platform with pagination controls for efficient data handling.
Instructions
List all contacts in Pylon with optional pagination
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Number of contacts to return (1-1000, default 100) | |
| cursor | No | Pagination cursor for next page |
Implementation Reference
- src/index.ts:165-183 (registration)Registers the 'pylon_list_contacts' MCP tool, including description, Zod input schema for pagination, and handler function that invokes PylonClient.listContacts and formats the response as text content.server.tool( 'pylon_list_contacts', 'List all contacts in Pylon with optional pagination', { limit: z .number() .min(1) .max(1000) .optional() .describe('Number of contacts to return (1-1000, default 100)'), cursor: z.string().optional().describe('Pagination cursor for next page'), }, async ({ limit, cursor }) => { const result = await client.listContacts({ limit, cursor }); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; }, );
- src/index.ts:177-182 (handler)The core handler function for the tool, which calls the client's listContacts method and returns the JSON-stringified result as MCP content.async ({ limit, cursor }) => { const result = await client.listContacts({ limit, cursor }); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; },
- src/index.ts:168-176 (schema)Zod schema defining the input parameters for the tool: optional limit (1-1000) and cursor for pagination.{ limit: z .number() .min(1) .max(1000) .optional() .describe('Number of contacts to return (1-1000, default 100)'), cursor: z.string().optional().describe('Pagination cursor for next page'), },
- src/pylon-client.ts:214-225 (helper)PylonClient.listContacts method: constructs query params for limit and cursor, makes GET request to /contacts endpoint, returns paginated list of contacts.async listContacts( params?: PaginationParams, ): Promise<PaginatedResponse<Contact>> { const searchParams = new URLSearchParams(); if (params?.limit) searchParams.set('limit', params.limit.toString()); if (params?.cursor) searchParams.set('cursor', params.cursor); const query = searchParams.toString(); return this.request<PaginatedResponse<Contact>>( 'GET', `/contacts${query ? `?${query}` : ''}`, ); }