get-browser-list
Retrieve browser profiles from AdsPower with filtering, sorting, and pagination options to manage and organize browser instances.
Instructions
Get the list of browsers
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| groupId | No | The group id of the browser, must be a numeric string (e.g., "123"). You can use the get-group-list tool to get the group list | |
| size | No | The size of the page, max is 100, if get more than 100, you need to use the page to get the next page, default is 10 | |
| page | No | The page of the browser, default is 1 | |
| id | No | The id of the browser | |
| serialNumber | No | The serial number of the browser | |
| sort | No | The sort of the browser | |
| order | No | The order of the browser |
Implementation Reference
- src/handlers/browser.ts:91-117 (handler)The handler function that implements the core logic of the 'get-browser-list' tool by querying the API for browser list and returning formatted JSON.async getBrowserList(params: GetBrowserListParams) { const { groupId, size, id, serialNumber, sort, order, page } = params; const urlParams = new URLSearchParams(); if (size) { urlParams.set('page_size', size.toString()); } if (page) { urlParams.set('page', page.toString()); } if (id) { urlParams.set('user_id', id); } if (groupId) { urlParams.set('group_id', groupId); } if (serialNumber) { urlParams.set('serial_number', serialNumber); } if (sort) { urlParams.set('user_sort', JSON.stringify({ [sort]: order || 'asc', })); } const response = await axios.get(`${LOCAL_API_BASE}${API_ENDPOINTS.GET_BROWSER_LIST}`, { params: urlParams }); return `Browser list: ${JSON.stringify(response.data.data.list, null, 2)}`; },
- src/types/schemas.ts:116-129 (schema)Zod schema defining the input parameters for the 'get-browser-list' tool.getBrowserListSchema: z.object({ groupId: z.string() .regex(/^\d+$/, "Group ID must be a numeric string") .optional() .describe('The group id of the browser, must be a numeric string (e.g., "123"). You can use the get-group-list tool to get the group list'), size: z.number().optional().describe('The size of the page, max is 100, if get more than 100, you need to use the page to get the next page, default is 10'), page: z.number().optional().describe('The page of the browser, default is 1'), id: z.string().optional().describe('The id of the browser'), serialNumber: z.string().optional().describe('The serial number of the browser'), sort: z.enum(['serial_number', 'last_open_time', 'created_time']).optional() .describe('The sort of the browser'), order: z.enum(['asc', 'desc']).optional() .describe('The order of the browser') }).strict(),
- src/utils/toolRegister.ts:26-27 (registration)Registration of the 'get-browser-list' tool on the MCP server, linking name, description, schema, and handler.server.tool('get-browser-list', 'Get the list of browsers', schemas.getBrowserListSchema.shape, wrapHandler(browserHandlers.getBrowserList));