update-group
Modify browser group details such as name and remark using the specified group ID. Streamline organization and management of browser profiles through the AdsPower LocalAPI MCP Server.
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 |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"groupId": {
"description": "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",
"pattern": "^\\d+$",
"type": "string"
},
"groupName": {
"description": "The new name of the group",
"type": "string"
},
"remark": {
"description": "The new remark of the group",
"type": [
"string",
"null"
]
}
},
"required": [
"groupId",
"groupName"
],
"type": "object"
}
Implementation Reference
- src/handlers/group.ts:27-43 (handler)The core handler function for the 'update-group' tool. It constructs a request body with group_id, group_name, and optional remark, then sends a POST request to the UPDATE_GROUP API endpoint. Returns success message or throws 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 input schema for 'update-group' tool, defining required groupId (numeric string), groupName (string), and optional nullable remark (string). Used for validation in tool registration.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 the wrapped handler function from groupHandlers.server.tool('update-group', 'Update the browser group', schemas.updateGroupSchema.shape, wrapHandler(groupHandlers.updateGroup));