Read the contacts table
query_contactsReads one page of the Contacts table and its exact count, as the Contacts page does, using the same filter tree: optional scope, search, match, filters, sort, offset, limit, and keyset paging (after / before / fromEnd). idsOnly: true answers every matching id (up to the select-all cap) instead of rows. Writes nothing. This is read-only, so idempotency_key only marks the retry.
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": {
"idempotency_key": "<idempotency_key>"
},
"name": "query_contacts"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sort | No | ||
| after | No | ||
| limit | No | ||
| match | No | all joins the filters with and (default), any with or. | |
| scope | No | Which contacts: active (default, every live contact), archived (archived and spam), or one of the page's built-in views (clients, leads, noname), which add that view's own conditions. | |
| before | No | ||
| offset | No | ||
| search | No | ||
| filters | No | The Contacts page's Filter rows. Each filter is { field, op, ...payload }. Fields and their ops: type: is_any_of|is_none_of (values client|lead|staff|applicant|other|spam|system); phone: contains|not_contains|is_empty|is_not_empty; email: contains|not_contains|is_empty|is_not_empty; company: contains|not_contains|is_empty|is_not_empty; address: contains|not_contains|is_empty|is_not_empty; service_type: is_any_of|is_none_of|is_empty|is_not_empty; home_size: is_any_of|is_none_of|is_empty|is_not_empty; bedrooms: is_any_of|is_none_of|is_empty|is_not_empty; bathrooms: is_any_of|is_none_of|is_empty|is_not_empty; preferred_cleaner: is_any_of|is_none_of|is_empty|is_not_empty; communication_preference: is_any_of|is_none_of|is_empty|is_not_empty; pets: is_any_of (values yes|no); vip: is_any_of (values yes|no); custom_field: is_any_of|is_none_of|contains|not_contains|is_empty|is_not_empty (values with fieldKey naming the field); service_category: is_any_of|is_none_of|is_empty|is_not_empty (values residential|commercial|both); lead_source: is_any_of|is_none_of|is_empty|is_not_empty (values thumbtack|google_lsa|yelp|bark|website_form|google_business_profile|referral|booking_software|direct|web_chat|facebook|instagram|other); list: is_any_of|is_none_of|is_empty|is_not_empty (values list ids); tag: is_any_of|is_none_of|is_empty|is_not_empty (values tag ids); notes: contains|not_contains|is_empty|is_not_empty; assignee: is_any_of|is_none_of; missing: is_any_of (values name|phone|email|company); date_added: in_last_days|more_than_days_ago|between; last_contact: in_last_days|more_than_days_ago|between|is_empty|is_not_empty; last_message: in_last_days|more_than_days_ago|between; campaign: is_any_of|is_none_of|is_empty|is_not_empty (values campaign ids); opted_out: is_any_of|is_none_of|is_empty|is_not_empty (values texts|emails|promos|email_promos|everything); lead_status: is_any_of|is_none_of|is_empty|is_not_empty (values new|contacted|in_campaign|in_discussion|quote_sent|closed|lost); lead_outcome: is_any_of|is_none_of|is_empty|is_not_empty (values open|booked|lost|cold|missed|not_a_lead|client); lead_closed: in_last_days|more_than_days_ago|between|is_empty|is_not_empty; provider: is_any_of|is_none_of|is_empty|is_not_empty (values any_staff|any_contractor|name:<name>); booking_count: eq|gt|lt|at_least|at_most|between; last_booking: in_last_days|more_than_days_ago|between|is_empty|is_not_empty; next_booking: in_next_days|between|is_empty|is_not_empty; first_booking: more_than_days_ago|in_last_days|between|is_empty|is_not_empty; frequency: is_any_of (values recurring|one_time); schedule: is_any_of|is_none_of|is_empty|is_not_empty (values weekly|every_2_weeks|every_3_weeks|every_4_weeks|every_6_weeks|every_8_weeks|custom_weekly|other); recurring_since: more_than_days_ago|in_last_days|between|is_empty|is_not_empty; last_service: is_any_of|is_none_of|is_empty|is_not_empty; last_booking_price: at_least|at_most|between|is_empty|is_not_empty; lifetime_value: gt|lt|at_least|at_most|between|is_empty|is_not_empty. Payload per op: is_any_of -> values: [...]; is_none_of -> values: [...]; contains -> text; not_contains -> text; in_last_days -> days; more_than_days_ago -> days; in_next_days -> days; between -> from+to (YYYY-MM-DD) for dates, min+max for numbers; eq -> number; gt -> number; lt -> number; at_least -> number; at_most -> number; is_empty -> nothing; is_not_empty -> nothing. Sort is a list of { field, dir: asc|desc } with field one of name|type|phone|email|company|assignee|last_contact|date_added|booking_count|last_booking|next_booking|lifetime_value|provider|service_category|lead_source. | |
| fromEnd | No | ||
| idsOnly | No | ||
| idempotency_key | Yes | Your id for this operation (8-128 of A-Z a-z 0-9 . _ : -). Reuse it on every retry of the same operation; use a new one for a new operation. |