get-group-list
Retrieve a list of groups from AdsPower LocalAPI by specifying group name, page size, and page number to manage browser profiles effectively.
Instructions
Get the list of groups
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| groupName | No | The name of the group to search, use like to search, often used group name to find the group id, so eg: "test" will search "test" and "test1" | |
| page | No | The page of the group, default is 1 | |
| 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 |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"groupName": {
"description": "The name of the group to search, use like to search, often used group name to find the group id, so eg: \"test\" will search \"test\" and \"test1\"",
"type": "string"
},
"page": {
"description": "The page of the group, default is 1",
"type": "number"
},
"size": {
"description": "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",
"type": "number"
}
},
"type": "object"
}
Implementation Reference
- src/handlers/group.ts:45-59 (handler)The handler function that implements the logic for 'get-group-list' tool by querying the API for groups with optional filters.async getGroupList({ groupName, size, page }: GetGroupListParams) { const params = new URLSearchParams(); if (groupName) { params.set('group_name', groupName); } if (size) { params.set('page_size', size.toString()); } if (page) { params.set('page', page.toString()); } const response = await axios.get(`${LOCAL_API_BASE}${API_ENDPOINTS.GET_GROUP_LIST}`, { params }); return `Group list: ${JSON.stringify(response.data.data.list, null, 2)}`; }
- src/types/schemas.ts:152-156 (schema)Zod input schema for validating parameters of the 'get-group-list' tool.getGroupListSchema: z.object({ groupName: z.string().optional().describe('The name of the group to search, use like to search, often used group name to find the group id, so eg: "test" will search "test" and "test1"'), 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 group, default is 1') }).strict(),
- src/utils/toolRegister.ts:42-43 (registration)Registers the 'get-group-list' tool on the MCP server using the schema and wrapped group handler.server.tool('get-group-list', 'Get the list of groups', schemas.getGroupListSchema.shape, wrapHandler(groupHandlers.getGroupList));