aggregate_records
ChatGPTCompute count / sum / avg / min / max over CRM records in the database — never page raw records just to add them up. Optionally filter first and group by one field. Currency metrics (e.g. sum of a deal value field) are automatically broken down per currency code. Group results are capped at 200 rows. Example — pipeline value and deal count per stage: {"table": "deals", "group_by": "fld_stage", "metrics": [{"op": "count"}, {"op": "sum", "field_id": "fld_value"}]}. Example — total open pipeline: add filters [{"field_id": "fld_stage", "operator": "is_not", "value": "Closed Lost"}]. Example — which channel our contacts came through: {"table": "contacts", "group_by": "fld_source", "metrics": [{"op": "count"}]}. Example — which system created them instead: same call with "group_by": "fld_record_source".
create_artifact
ChatGPTSave a finished list of prospects as an artifact in the workspace so it can be opened later and, once sharing is enabled, sent to someone outside it. A prospect list is the only thing this tool can hold today; any other analysis stays in the conversation. Supply the body as structured data in the payload schema's field names — never HTML or markdown markup; the page is rendered from those fields, and a payload it cannot render is refused with the reasons.
create_record
ChatGPTSave a record into a CRM table. Identity resolution runs automatically: if your values match an existing record on one of the table's identity fields (email / phone / LinkedIn or website URL — marked "identity" in get_table_schema, compared normalized and case-insensitive), that record is enriched instead of a duplicate being created — do NOT search for duplicates first. Returns {id, table_id, table, title, action: "created"|"updated"}. Possible outcomes: a write that only fills blank fields applies immediately. One that would overwrite existing values, or that matches an existing record only by name, is not applied: it returns status "needs_confirmation" with the diff or the candidate records; show them to the user and repeat the call with confirmed_option only after they decide. If identity fields match two or more different records nothing is written and the error lists them — the table already holds duplicates only a human should merge. Set allow_duplicate=true ONLY after the user explicitly said to create a new record despite an existing same-name one. Example: {"table_id": "<uuid>", "fields": {"fld_name": "Jane Doe", "fld_email": "jane@acme.com"}}. Field value encoding by type: - text / email / phone: plain string - number: JSON number (42 or 3.5) - currency: {"amount_minor": <integer, smallest unit — cents for usd>, "currency": "<lowercase ISO 4217>"}. Example: $48,000 USD -> {"amount_minor": 4800000, "currency": "usd"} - date: "YYYY-MM-DD" for a calendar day (the default). When the field's properties carry include_time, an RFC3339 timestamp with the user's offset, e.g. "2026-08-27T10:00:00+08:00". Unix epoch milliseconds are also accepted. - single_select: the option NAME exactly as the schema lists it (e.g. "Negotiation") - multi_select: array of option names (e.g. ["Inbound", "Hot"]) - checkbox: true or false - url: {"text": "acme.com", "link": "https://acme.com"} - attachment: array of file items, each {"url": "https://…", "filename": "…", "media_type": "…"}. When the user sent a file in chat, an "Attachment reference" line next to it gives you the exact value to use. Single-image fields like a contact avatar take a one-element array. Example: [{"url": "https://cdn…/photo.jpg", "filename": "photo.jpg", "media_type": "image/jpeg"}] - user: the user's UUID string - relation: array of target record UUIDs (e.g. ["9b2f..."]) Never include derived fields (fld_created_at, fld_updated_at, fld_created_by, fld_updated_by, fld_record_source) — they are maintained by the system and writes to them are rejected. The table's own fld_source (Source / Deal Source) is NOT derived — it is an ordinary field you may write.
get_artifact
ChatGPTRead back an artifact — its title, subject and structured body — by id or by the link to it: one you made, or one a colleague shared with the workspace or by link. Use when work saved earlier has to be acted on now: turning a saved list into records, checking what a page says before sending it, or comparing two runs.
get_record
ChatGPTGet a single CRM record by its ID. Returns the full record with all field values. Use when you need to look up specific record details.
get_table_schema
ChatGPTGet a CRM table's schema enriched with live data stats: per-field descriptions, select options, top stored values with counts, distinct counts, numeric/date min-max bounds, and the total record count. Call this before querying or writing a table you have not inspected this conversation — the stats tell you the exact stored values to filter on. Look up by table name ('companies', 'contacts', 'deals') or table_id. Set include_stats to false only when you need the field list fastest.
list_artifacts
ChatGPTList the artifacts you made, newest first, with their titles, subjects and links. Use to find the one being talked about — people remember what a page was about, not its id. A colleague's artifact is not listed even when shared; read it with get_artifact from the link they sent.
search_crm
ChatGPTSearch every CRM table at once — companies, contacts, deals and custom tables. Finds exact text (names, emails, domains — Chinese and English, typo-tolerant) and meaning-level matches. Returns compact hits carrying record_id, table and title; follow up with get_record for detail. For structured conditions inside ONE table (stage, amounts, dates) use search_records with filters instead.
search_records
ChatGPTQuery CRM records in a table with structured filters and sorts, executed in the database. ALWAYS push conditions down as filters instead of paging the whole table and scanning it yourself — the response includes the total match count. For counts, sums or averages use aggregate_records instead of fetching rows. Use get_table_schema first for field ids and the exact stored values to filter on. Example — open deals in stage Negotiation worth over $10,000, largest first: {"table": "deals", "filters": [{"field_id": "fld_stage", "operator": "is", "value": "Negotiation"}, {"field_id": "fld_value", "operator": "after", "value": "1000000"}], "sorts": [{"field_id": "fld_value", "desc": true}]}. Example — contacts the Stripe sync created, newest first: {"table": "contacts", "filters": [{"field_id": "fld_record_source", "operator": "is", "value": "auto_stripe_sync"}], "sorts": [{"field_id": "fld_created_at", "desc": true}]}. Returns up to 50 records per call; when has_more is true, page with skip.
update_record
ChatGPTUpdate a CRM record's fields by its ID. Provide the record_id and a fields object mapping field IDs to new values — only the fields you want to change. Use get_table_schema for field ids, types and valid select options. Date fields: write YYYY-MM-DD unless the field's properties carry include_time (then RFC3339 with the user's offset). A write that only fills blank fields applies immediately. One that would overwrite existing non-empty values is not applied: it returns status "needs_confirmation" with the current and proposed values. Show them to the user and repeat the same call with confirmed=true only after they approve. Example: {"record_id": "<uuid>", "fields": {"fld_stage": "Closed Won", "fld_value": {"amount_minor": 4800000, "currency": "usd"}}}. Field value encoding by type: - text / email / phone: plain string - number: JSON number (42 or 3.5) - currency: {"amount_minor": <integer, smallest unit — cents for usd>, "currency": "<lowercase ISO 4217>"}. Example: $48,000 USD -> {"amount_minor": 4800000, "currency": "usd"} - date: "YYYY-MM-DD" for a calendar day (the default). When the field's properties carry include_time, an RFC3339 timestamp with the user's offset, e.g. "2026-08-27T10:00:00+08:00". Unix epoch milliseconds are also accepted. - single_select: the option NAME exactly as the schema lists it (e.g. "Negotiation") - multi_select: array of option names (e.g. ["Inbound", "Hot"]) - checkbox: true or false - url: {"text": "acme.com", "link": "https://acme.com"} - attachment: array of file items, each {"url": "https://…", "filename": "…", "media_type": "…"}. When the user sent a file in chat, an "Attachment reference" line next to it gives you the exact value to use. Single-image fields like a contact avatar take a one-element array. Example: [{"url": "https://cdn…/photo.jpg", "filename": "photo.jpg", "media_type": "image/jpeg"}] - user: the user's UUID string - relation: array of target record UUIDs (e.g. ["9b2f..."]) Never include derived fields (fld_created_at, fld_updated_at, fld_created_by, fld_updated_by, fld_record_source) — they are maintained by the system and writes to them are rejected. The table's own fld_source (Source / Deal Source) is NOT derived — it is an ordinary field you may write.
whoami
ChatGPTIdentify this Dopia connection: workspace name and id, the key's scopes, and the CRM tables available (id, name, field count). Call once at the start of a session, before any other Dopia tool — table names from here feed get_table_schema.
aggregate_records
Claudecreate_artifact
Claudecreate_record
Claudeget_artifact
Claudeget_record
Claudeget_table_schema
Claudelist_artifacts
Claudesearch_crm
Claudesearch_records
Claudeupdate_record
Claudewhoami
Claude