move-browser
Transfer browser profiles to specified groups by providing group ID and browser IDs. Simplify profile management and organization in AdsPower LocalAPI.
Instructions
Move browsers to a group
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| groupId | Yes | The target group id, must be a numeric string (e.g., "123"). You can use the get-group-list tool to get the group list | |
| userIds | Yes | The browser ids to move |
Implementation Reference
- src/handlers/browser.ts:128-138 (handler)The moveBrowser function that implements the core logic of the 'move-browser' tool by making an HTTP POST request to move specified browsers (userIds) to a target group (groupId).async moveBrowser({ groupId, userIds }: MoveBrowserParams) { const response = await axios.post(`${LOCAL_API_BASE}${API_ENDPOINTS.MOVE_BROWSER}`, { group_id: groupId, user_ids: userIds }); if (response.data.code === 0) { return `Browsers moved successfully to group ${groupId}: ${userIds.join(', ')}`; } throw new Error(`Failed to move browsers: ${response.data.msg}`); }
- src/types/schemas.ts:131-136 (schema)Zod input schema defining validation for 'move-browser' tool parameters: groupId (numeric string) and userIds (array of strings).moveBrowserSchema: z.object({ groupId: z.string() .regex(/^\d+$/, "Group ID must be a numeric string") .describe('The target group id, must be a numeric string (e.g., "123"). You can use the get-group-list tool to get the group list'), userIds: z.array(z.string()).describe('The browser ids to move') }).strict(),
- src/utils/toolRegister.ts:32-33 (registration)Registers the 'move-browser' tool on the MCP server, providing description, input schema, and wrapped handler reference.server.tool('move-browser', 'Move browsers to a group', schemas.moveBrowserSchema.shape, wrapHandler(browserHandlers.moveBrowser));