update-group
Modify browser group settings in AdsPower by changing the group name and adding optional remarks to organize browser profiles more effectively.
Instructions
Update the browser group
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| groupId | Yes | The id of the group to update, must be a numeric string (e.g., "123"). You can use the get-group-list tool to get the group list | |
| groupName | Yes | The new name of the group | |
| remark | No | The new remark of the group |
Implementation Reference
- src/handlers/group.ts:27-43 (handler)The main handler function for the 'update-group' tool. It constructs a request body with groupId, groupName, and optional remark, sends a POST request to the UPDATE_GROUP API endpoint, and returns a success message or throws an error.
async updateGroup({ groupId, groupName, remark }: UpdateGroupParams) { const requestBody: Record<string, any> = { group_id: groupId, group_name: groupName }; if (remark !== undefined) { requestBody.remark = remark; } const response = await axios.post(`${LOCAL_API_BASE}${API_ENDPOINTS.UPDATE_GROUP}`, requestBody); if (response.data.code === 0) { return `Group updated successfully with id: ${groupId}, name: ${groupName}${remark !== undefined ? `, remark: ${remark === null ? '(cleared)' : remark}` : ''}`; } throw new Error(`Failed to update group: ${response.data.msg}`); }, - src/types/schemas.ts:144-150 (schema)Zod schema defining the input parameters for the 'update-group' tool: groupId (required numeric string), groupName (required string), remark (optional nullable string).
updateGroupSchema: z.object({ groupId: z.string() .regex(/^\d+$/, "Group ID must be a numeric string") .describe('The id of the group to update, must be a numeric string (e.g., "123"). You can use the get-group-list tool to get the group list'), groupName: z.string().describe('The new name of the group'), remark: z.string().nullable().optional().describe('The new remark of the group') }).strict(), - src/utils/toolRegister.ts:39-40 (registration)Registers the 'update-group' tool with the MCP server, providing name, description, input schema, and wrapped handler.
server.tool('update-group', 'Update the browser group', schemas.updateGroupSchema.shape, wrapHandler(groupHandlers.updateGroup));