Tools — Data
Aggregations, global search, bulk operations, import/export, duplicate detection, pipeline management, and lists.
Eight tools for querying, transforming, and managing CRM data at scale.
crm_aggregate
SQL-native aggregation: count, sum, average, min, max, with optional grouping.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
object_name | string | yes | Target object (e.g., contacts, opportunities) |
field | string | yes | Field to aggregate |
function | enum | yes | COUNT, SUM, AVG, MIN, MAX, or COUNT_DISTINCT |
group_by | string | no | Field to group results by |
filter_field | string | no | Field to filter on before aggregating |
filter_operator | string | no | Filter operator: equals, not_equals, contains, greater_than, less_than, greater_equal, less_equal, is_null, is_not_null |
filter_value | string | no | Value to filter against |
Behavior
- Validates that the field exists on the target object.
- Rejects
SUMandAVGon non-numeric field types (TEXT, SELECT, etc.). - When
group_byis provided, returns one row per distinct group value.
Example
"How many contacts do I have per status?"
{
"object_name": "contacts",
"field": "id",
"function": "COUNT",
"group_by": "status"
}crm_global_search
Search across ALL objects in one call.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | yes | Search term (minimum 2 characters) |
limit | number | no | Max results per object. Default 20, max 50. |
offset | number | no | Pagination offset |
object_name | string | no | Restrict search to a single object |
Behavior
- Searches all fields of type TEXT, EMAIL, URL, PHONE, and TEXTAREA.
- Results are grouped by object type.
- When
object_nameis provided, only that object is searched.
Example
"Find everything related to Acme"
{
"query": "acme"
}Returns matches across contacts, companies, opportunities, and any custom objects.
crm_bulk_update
Batch operations on multiple records.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
action | enum | yes | update_field, add_relation, or remove_relation |
object_name | string | yes | Target object |
record_ids | string[] | yes | IDs of records to update |
field_name | string | cond. | Field to update (required for update_field) |
field_value | string | cond. | New value (required for update_field) |
relation_field | string | cond. | Relation field name (required for add_relation / remove_relation) |
target_ids | string[] | cond. | Related record IDs (required for add_relation / remove_relation) |
Behavior
- RBAC is enforced per record -- if the user lacks write access to a specific record, that record fails without blocking the rest.
- Partial failure is supported: the response reports which records succeeded and which failed.
Example
"Set the description to 'VIP client' on these 3 contacts"
{
"action": "update_field",
"object_name": "contacts",
"record_ids": ["id-1", "id-2", "id-3"],
"field_name": "description",
"field_value": "VIP client"
}crm_import
Import data from JSON or CSV.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
object_name | string | yes | Target object |
format | enum | yes | json or csv |
data | string | yes | The data payload as a string |
Behavior
- CSV is parsed with PapaParse. Column headers are required and must match field names.
- Pipeline defaults are auto-applied when the target object has a PIPELINE field.
- Duplicate records are counted separately in the response.
- Under 100 records: imported immediately and the result is returned inline.
- 100 records or more: the import is queued as a background job and a job ID is returned.
Example
"Import these 5 contacts"
{
"object_name": "contacts",
"format": "json",
"data": "[{\"first_name\":\"Alice\",\"last_name\":\"Martin\",\"email\":\"alice@example.com\"},{\"first_name\":\"Bob\",\"last_name\":\"Dupont\",\"email\":\"bob@example.com\"},{\"first_name\":\"Clara\",\"last_name\":\"Duval\",\"email\":\"clara@example.com\"},{\"first_name\":\"David\",\"last_name\":\"Leroy\",\"email\":\"david@example.com\"},{\"first_name\":\"Eva\",\"last_name\":\"Moreau\",\"email\":\"eva@example.com\"}]"
}crm_export
Export records as JSON or CSV.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
object_name | string | yes | Source object |
format | enum | yes | json or csv |
fields | string[] | no | Specific fields to include (defaults to all) |
filter_field | string | no | Field to filter on |
filter_operator | string | no | Filter operator: equals, not_equals, contains, in, greater_than, less_than, greater_equal, less_equal, is_null, is_not_null |
filter_value | string | no | Filter value |
limit | number | no | Max records to export. Default 500, max 2000. |
Behavior
- When
fieldsis omitted, all fields on the object are exported. - The hard limit is 2000 records per export call.
Example
"Export all contacts as CSV"
{
"object_name": "contacts",
"format": "csv"
}crm_find_duplicates
Detect and merge duplicate records.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
action | enum | yes | detect or merge |
object_name | string | yes | Target object |
min_score | number | no | Minimum similarity score (0-100, default 70, detect only) |
fields | string[] | no | Fields to compare (detect only) |
limit | number | no | Max duplicate groups to return (detect only) |
master_id | string | cond. | Record to keep (merge only) |
duplicate_ids | string[] | cond. | Records to merge into master (merge only) |
merge_strategy | enum | no | keep_master or fill_blanks (merge only, defaults to fill_blanks) |
Behavior
- Detect compares records by email, phone, LinkedIn URL, and name (case-insensitive). Returns groups of potential duplicates ranked by similarity score.
- Merge re-links all BELONGS_TO_ONE and MANY_TO_MANY relations from duplicate records to the master before deleting the duplicates. With
fill_blanks, empty fields on the master are filled from duplicates before deletion.
Example
"Find duplicate contacts"
{
"action": "detect",
"object_name": "contacts"
}"Merge these duplicates into the master"
{
"action": "merge",
"object_name": "contacts",
"master_id": "uuid-master",
"duplicate_ids": ["uuid-dup-1", "uuid-dup-2"],
"merge_strategy": "fill_blanks"
}crm_move_deal
Move a record through pipeline stages.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
object_name | string | yes | Object with a PIPELINE field |
record_id | string | yes | Record to move |
step_id | string | yes | Target pipeline step ID |
Behavior
- Works on any object that has a PIPELINE field, not just opportunities.
- Validates that the target step belongs to the correct pipeline for the record.
- The pipeline ID is auto-inferred from the record -- you only need to provide the step.
Example
"Move this opportunity to the Negotiation stage"
{
"object_name": "opportunities",
"record_id": "uuid-opp",
"step_id": "uuid-negotiation-step"
}crm_manage_lists
Manage multi-object lists (custom collections).
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
action | enum | yes | list, get_entries, add, or remove |
list_id | string | cond. | Target list ID (required for all actions except list) |
record_id | string | cond. | Record to add or remove (required for add / remove) |
limit | number | no | Max entries to return (get_entries only). Default 50, max 200. |
Behavior
- Lists can contain records from any object type, acting as cross-object collections.
listreturns all available lists for the current user.get_entriesreturns the records in a list with their object type and display name.
Example
"Add this contact to my priority list"
{
"action": "add",
"list_id": "uuid-priority-list",
"record_id": "uuid-contact"
}