pylon_list_accounts
Retrieve all customer accounts from the Pylon support platform with pagination controls to manage large datasets efficiently.
Instructions
List all accounts in Pylon with optional pagination
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Number of accounts to return (1-1000, default 100) | |
| cursor | No | Pagination cursor for next page |
Implementation Reference
- src/index.ts:42-60 (registration)Registers the pylon_list_accounts tool with MCP server, including input schema (limit, cursor) and handler that calls PylonClient.listAccounts and returns JSON-formatted response.
server.tool( 'pylon_list_accounts', 'List all accounts in Pylon with optional pagination', { limit: z .number() .min(1) .max(1000) .optional() .describe('Number of accounts to return (1-1000, default 100)'), cursor: z.string().optional().describe('Pagination cursor for next page'), }, async ({ limit, cursor }) => { const result = await client.listAccounts({ limit, cursor }); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; }, ); - src/index.ts:54-59 (handler)Inline handler function for the pylon_list_accounts tool, which invokes the PylonClient.listAccounts method with provided parameters and serializes the result.
async ({ limit, cursor }) => { const result = await client.listAccounts({ limit, cursor }); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; }, - src/index.ts:45-53 (schema)Zod schema defining optional input parameters 'limit' (1-1000) and 'cursor' for pagination in pylon_list_accounts tool.
{ limit: z .number() .min(1) .max(1000) .optional() .describe('Number of accounts to return (1-1000, default 100)'), cursor: z.string().optional().describe('Pagination cursor for next page'), }, - src/pylon-client.ts:155-166 (helper)PylonClient.listAccounts helper method that constructs the API GET request to /accounts with pagination query parameters and returns paginated list of accounts.
async listAccounts( params?: PaginationParams, ): Promise<PaginatedResponse<Account>> { 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<Account>>( 'GET', `/accounts${query ? `?${query}` : ''}`, ); }