Add contact to group
civicrm_add_to_groupAdd a contact to a CiviCRM group, updating existing memberships to avoid duplicates.
Instructions
Add a contact to a group (GroupContact status='Added'). Idempotent — updates an existing row rather than creating duplicates. Requires CIVICRM_ALLOW_WRITES=true.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"contact_id": "<contact_id>",
"group_id": "<group_id>"
},
"name": "civicrm_add_to_group"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| group_id | Yes | CiviCRM group id (not title). | |
| contact_id | Yes |