change_quotation_status
ChatGPTChange an Xero quotation's status (e.g. mark as sent, accepted, declined, invoiced, or deleted).
check_xero_contact_link_tool
ChatGPTCheck whether a CRM account is linked to a Xero contact.
create_activity
ChatGPTCreate a new activity (NOTE/TASK/LOG/EVENT) linked to one or more business records. Before creating, collect the required fields from the user — never invent, assume, or auto-fill values the user didn't provide. Use defaults unless the user explicitly overrides them.
create_business_record
ChatGPTCreate a new business record in a module. Field value formats: - Text: String value directly - Number: Numeric value - Date/DateTime: ISO 8601 format - Currency: {"currencyType": "USD", "amount": 1000} - Phone: String with country code - Email: Valid email string - Reference fields (Account, Assigned to): Use the ID - Enum/Select: Use raw enum value (e.g. "OPEN", not display label) - Percent: string (e.g. "75")
create_quotation
ChatGPTCreate a new Xero quotation for a CRM account. Requires the account to already have a linked Xero contact (xeroContactId). Returns only the new quotation's id — displaying it is handled in the UI.
create_ticket
ChatGPTCreate a new support ticket. Call get_module_schema (moduleId: "TM") first for valid pipeline/pipelineStage IDs and confirm details with the user before creating.
find_assignable_users
ChatGPTGet valid assignee suggestions for a CRM module — call before assigning a record to find who can be assigned. If same name appears, take confirmation from user before assigning. Do not call this when asked to assign to "me" — use get_current_user instead
get_accessible_modules
ChatGPTGet the list of CRM modules the current user can access
get_activities
ChatGPTFind activities (notes, tasks, logs, events) linked to a specific business record, latest first.
get_associated_activities
ChatGPTFind activities (notes, tasks, logs, events) linked to a specific business record, latest first.
get_associated_records
ChatGPTGet business records associated with (linked to) a given record, grouped by module. Resolve the source record's _id via get_records first.
get_conversation_users
ChatGPTList users available for conversation assignment. Use user names, not ids, when talking to the user.
get_conversations_aggregate
ChatGPTRun a MongoDB 6.0 aggregation pipeline on conversations and messages — call get_module_schema with moduleId = MSG for rules and schema first, if not already known. You never receive raw field data back — only one of: Set queryType to say which kind of query this is — it changes what you get back: - "list": use $match / $sort / $skip / $limit to filter and order; the tool returns just the matching conversation ids (an id-only projection, capped at 100). This is a sample — enough to validate the query — NOT the full result set. Do not treat it as complete, and do not tell the user that only a sample exists. - "analysis": use $group / $count / $sum / $avg and other arithmetic stages to compute counts, totals, averages, and other summaries entirely server-side; the computed result comes back complete — analyze and report it confidently, don't hedge or imply more data exists. Since no field values come back, do all filtering, sorting, and math inside the pipeline — never expect to read conversations to reason over them afterwards. The sample cap on ids applies only to this tool call, not to the full result set: when the user wants to see or list conversations, always populate moduleId (MSG) / aggregatePipeline in your response regardless of this cap — that is how the complete result is produced and shown. Never tell the user that only a sample of conversations can be shown, and never propose fetching "the next batch" yourself — that's driven by sortFieldId / sortDirection in your response, not by re-calling this tool.
get_conversations_aggregate_paginated
ChatGPTRun a MongoDB aggregation over conversations — use for any conversation list/count/search query. Returns real, complete results — {total, limit, skip, conversationIds} — not a capped sample. Use page/pageSize/sorted to page through results when total exceeds what's already been returned. Call get_module_schema (moduleId: MSG) first for field names and pipeline-building guidance. Don't include $sort/$skip/$limit in the pipeline itself — use page/pageSize/sorted instead.
get_conversations_data
ChatGPTRun a MongoDB aggregation over conversations — use for any conversation list/count/search query, whether the pipeline returns matching conversation ids or a computed answer ($group/$count/$sum/$avg etc.). Returns real, complete results — {total, limit, skip, conversationIds} — not a capped sample. Use page/pageSize/sorted to page through a plain filter's results when total exceeds what's already been returned; a computed pipeline returns its answer directly, unpaged. Call get_module_schema (moduleId: MSG) first for field names and pipeline-building guidance. Don't include $sort/$skip/$limit in the pipeline itself — use page/pageSize/sorted instead.
get_crm_users
ChatGPTList all CRM sales and support team members. Not for conversation/message assignees.
get_current_user
ChatGPTGet who is calling — the authenticated user's own CRM user id, name and email. Call this first whenever a request refers to the caller ("me", "my", "assign to me") and use the returned id for the assignee field. Never guess who the caller is from get_crm_users.
get_exchange_rate
ChatGPTGet current exchange rates for all supported currencies. Call before summing or averaging amounts across currencies.
get_integrations
ChatGPTFetch messaging channel integrations (e.g. WhatsApp, Xero, Telegram) configured for the account.
get_module_schema
ChatGPTGet the fields, their types, and the record or activityType shape for any CRM module
get_quotation_by_id
ChatGPTGet one or more Xero quotations' full details by id. Only call this to fetch current data before update_quotation — never for displaying quotation details, which the UI handles.
get_quotation_form
ChatGPTGet Xero form configuration (items, tax rates, branding themes, currencies) needed to build a quotation.
get_quotations_aggregate_paginated
ChatGPTRun a MongoDB aggregation over quotations — use for any quotation list/count/search/analysis query. Returns real, complete results — {recordsTotal, limit, skip, quotations} — not a capped sample. Use page/pageSize/sorted to page through results when total exceeds what's already been returned. Call get_module_schema (moduleId: "QTM") first for field names, ObjectId rules, and pipeline-building guidance. Don't include $sort/$skip/$limit in the pipeline itself — use page/pageSize/sorted instead.
get_quotations_data
ChatGPTRun a MongoDB aggregation over quotations — use for any list/count/search query, whether the pipeline returns raw documents or a computed answer ($group/$count/$sum/$avg etc.). Returns real, complete results — {recordsTotal, limit, skip, quotations} — not a capped sample. - The Quotation collection is flat: fields sit at the top level, NOT under records.<fieldId>. Before your first query, call get_module_schema with moduleId: "QTM" for the quotation query guide (field names, quote status values, ObjectId rules). - _id, accId, oppId, and user are ObjectIds — always match them as EJSON {"$oid": "<id>"}. A raw string matches nothing and returns an empty result that looks like "no data". - No $lookup, and no $sort/$skip/$limit in the pipeline — use sorted/page/pageSize instead. - Send whichever kind of pipeline answers the question — a plain filter or a $group/$count/$sum computation — page/pageSize page a plain filter; a computed pipeline returns its answer directly, unpaged.
get_records_data
ChatGPTRun a MongoDB aggregation over a CRM module's records, or Activities (NOTE, TASK, LOG, EVENT) when activityType is set — use for any list/count/search query, whether the pipeline returns raw documents or a computed answer ($group/$count/$sum/$avg etc.). Returns real, complete results — {total, limit, skip, records} — not a capped sample. Use page/pageSize/sorted to page through results when total exceeds what's already been returned. - Call get_module_schema first for field ids and types. - _id is a native ObjectId — always match it as EJSON {"$oid": "<id>"}, never a raw string. A raw string matches nothing and returns an empty result that looks like "no data". - Send whichever kind of pipeline answers the question — a plain filter or a $group/$count/$sum computation — page/pageSize page a plain filter; a computed pipeline returns its answer directly, unpaged. - Always project raw database paths only (e.g. records.F2: 1, records.F3: 1) in a filter pipeline — there's no separate response-table renderer here to keep raw fields for. - Don't include $sort/$skip/$limit in the pipeline itself — use sorted/page/pageSize instead. - Omit sorted on a $group/$count/$sum pipeline — the backend's sort step only preserves a fixed set of record field names and will silently drop custom computed field names; grouped results come back in their natural order without it.
get_records_paginated
ChatGPTQuery a CRM module's records, or Activities (NOTE, TASK, LOG, EVENT) when activityType is given, with a MongoDB aggregation pipeline. Returns real, complete results — {total, limit, skip, records} — not a capped sample. Use page/pageSize/sorted to page through more when total exceeds what's already been returned. Build the pipeline from the field ids and types from get_module_schema. Always project raw database paths only (e.g. records.F2: 1, records.F3: 1).
get_suggestion_params
ChatGPTGet valid assignee suggestions for a CRM module — call before assigning a record to find who can be assigned. If same name appears, take confirmation from user before assigning. Do not call this when asked to assign to "me" — use get_current_user instead
get_ticket_activity_data
ChatGPTRun a MongoDB aggregation over TicketActivity — ticket audit/timeline data. Use for any list/count/search query, whether the pipeline returns raw documents or a computed answer ($group/$count/$sum/$avg etc.). Returns real, complete results — {total, limit, skip, records} — not a capped sample. TICKET ACTIVITY aggregation reference (for get_ticket_activity) — use this for ticket audit/timeline questions: which field changed, what the new value was, when, and who made the change. Base collection TicketActivity (one document per change/event on a ticket): - ticket, org, channelId are stored as native ObjectId — match or compare with EJSON {"$oid": "<id>"}, never a raw string. A raw string silently matches nothing. - user and assignedBy may be an ObjectId OR a string depending on the document — compare with $expr + $toString rather than raw equality, same as Ticket's own user field. - changes is an array of {fieldId, fieldName, oldValue, newValue} — the authoritative field-level diff. This is what "what changed" / "what was the new value" questions should read. Match on fieldId (the raw field id, e.g. "F_C41"), not fieldName (a display label) — get ids from get_module_schema (moduleId "TM"). - type marks the kind of event. Values vary by which service wrote the row — treat this as an open set, not a fixed enum: seen values include CREATE, UPDATE, ASSIGNEE, ESCALATE, CLOSE, DELETE, SLA_EXCEEDED, SLA_CLOSURE_EXCEEDED, TICKET_COMMENT, TICKET_CHECKLIST, ASSOCIATE, DISSOCIATE, BULK_EDIT, UPDATE_CUSTOM_DATA, and others. Don't assume this list is exhaustive. - source is the channel/origin the change came through — also an open set, shared across services. - status on the document itself (ACTIVE/DELETED) is a soft-delete flag the backend already filters out — don't project or match on it. - No $lookup — keep pipelines flat; user/assignedBy names aren't denormalized, so don't expect to project display names directly. Common question patterns: - "Which field was updated / what was the new value / when / who made it (for ticket X)": {"$match": {"ticket": {"$oid": "<id>"}}}, then read changes, createdAt, user from each row. queryType "list". - "How many new tickets were created on date X": {"$match": {"type": "CREATE", "createdAt": {"$gte": "<X, ISO 8601>", "$lt": "<X+1 day, ISO 8601>"}}}, {"$count": "total"}. queryType "analysis". - "How many tickets were marked as Sold / updated with <value> in a custom field": {"$match": {"changes": {"$elemMatch": {"fieldId": "<fieldId>", "newValue": "<value>"}}}}, {"$group": {"_id": "$ticket"}}, {"$count": "total"} (groups by ticket first so a ticket changed more than once isn't double-counted). queryType "analysis". - "Tickets where any custom field was updated": {"$match": {"changes": {"$elemMatch": {"fieldId": {"$in": ["<customFieldId>", ...]}}}}}. queryType "list". - "Which user updated those tickets, and when": same $match as above, project user and createdAt per matching row instead of grouping. queryType "list". Set queryType: - "list": the pipeline returns individual activity documents (a filter). The result is capped to a small sample — enough to validate the query, NOT the full dataset. No $sort/$skip/$limit — the app applies its own ordering/paging. - "analysis": the pipeline computes an answer ($group, $count, $sum/$avg accumulators, etc.). The result comes back complete — analyze and report it confidently, don't hedge or imply more data exists. Default table order: set sortFieldId: "createdAt" and sortDirection: "desc" (most recent first) unless the user explicitly asked for a different order. Don't leave sortFieldId null and don't default to ascending/oldest-first here. - Send whichever kind of pipeline answers the question — a plain filter or a $group/$count/$sum computation — page/pageSize page a plain filter; a computed pipeline returns its answer directly, unpaged. - Don't include $sort/$skip/$limit in the pipeline itself — the backend appends its own trailing sort (default createdAt: -1) after your pipeline regardless, silently overriding …
get_ticket_info
ChatGPTFetch comments, checklist, and/or timeline for a ticket.
get_tickets_aggregate_paginated
ChatGPTRun a MongoDB aggregation over tickets — use for any ticket list/count/search/analysis query. Returns real, complete ticket documents — {total, limit, skip, records} — not a capped sample or id-only list. Use page/pageSize to page through results when total exceeds what's already been returned. Call get_module_schema (moduleId: "TM") first for field names, ObjectId rules, and pipeline-building guidance. Don't include $skip/$limit in the pipeline itself — use page/pageSize instead; $sort is fine to include in the pipeline.
get_tickets_data
ChatGPTRun a MongoDB aggregation over tickets — use for any list/count/search query, whether the pipeline returns raw documents or a computed answer ($group/$count/$sum/$avg etc.). Returns real, complete results — {total, limit, skip, records} — not a capped sample or id-only list. - Call get_module_schema (moduleId: "TM") first for custom field ids. Standard fields sit at the top level of the document; custom fields are nested under records.<fieldId>. - _id, org, pipeline, pipelineStage, and contact are ObjectIds — always match them as EJSON {"$oid": "<id>"}. A raw string matches nothing and returns an empty result that looks like "no data". - user may be an ObjectId OR a string depending on the document. Compare it with $expr + $eq on $toString, never raw equality. - Send whichever kind of pipeline answers the question — a plain filter or a $group/$count/$sum computation — page/pageSize page a plain filter; a computed pipeline returns its answer directly, unpaged. - Don't include $sort/$skip/$limit in the pipeline itself — the backend appends its own trailing sort (default createdAt: -1) after your pipeline regardless, silently overriding any $sort you put there; use sorted to actually control order, and page/pageSize for paging.
get_xero_contacts
ChatGPTList Xero contacts available for linking to a CRM account.
save_activity
ChatGPTCreate a new activity (mode='create', NOTE/TASK/LOG/EVENT) linked to one or more business records, or update fields on an existing one (mode='update'). For updates, include only the fields being changed, using exact fieldIds. Before creating, collect the required fieldsfrom the user — never invent, assume, or auto-fill values the user didn't provide. Use defaults unless the user explicitly overrides them.
save_business_record
ChatGPTCreate a new business record (mode='create') or update fields on an existing one (mode='update'). For updates, include only the fields being changed. Field value formats: - Text: String value directly - Number: Numeric value - Date/DateTime: ISO 8601 format - Currency: {"currencyType": "USD", "amount": 1000} - Phone: String with country code - Email: Valid email string - Reference fields (Account, Assigned to): Use the ID - Enum/Select: Use raw enum value (e.g. "OPEN", not display label) - Percent: string (e.g. "75")
save_ticket
ChatGPTCreate a new support ticket (mode='create') or update fields on an existing one (mode='update'), including escalating it or closing it. Call get_module_schema (moduleId: "TM") first for valid pipeline/pipelineStage IDs and confirm details with the user before creating. For updates, records must contain ONLY the fields actually changing — omit anything unchanged, and never pass null for a field just to keep it as-is. Escalate with escalate=true, or close via records.status="CLOSED".
search_knowledge_base
ChatGPTSearch the Organization knowledge base such as Pdf, Docs, and other knowledge base articles.
sync_xero_contact_tool
ChatGPTCreate a new Xero contact for a CRM account, or link the account to an existing Xero contact.
sync_xero_quote_tool
ChatGPTPush/sync a CRM quotation with Xero.
update_activity
ChatGPTUpdate fields on an existing activity. Look up the activity first to get its _id — never guess it. Include only the fields being changed, using exact fieldIds.
update_business_record
ChatGPTUpdate fields on an existing business record. Look up the record first to get its _id — never guess it. Include only the fields being changed. Field value formats: - Text: String value directly - Number: Numeric value - Date/DateTime: ISO 8601 format - Currency: {"currencyType": "USD", "amount": 1000} - Phone: String with country code - Email: Valid email string - Reference fields (Account, Assigned to): Use the ID - Enum/Select: Use raw enum value (e.g. "OPEN", not display label) - Percent: string (e.g. "75")
update_quotation
ChatGPTUpdate an existing Xero quotation. Requires the full payload — call get_quotation_by_id first to get current field values, then send them all back with the changed fields updated. Returns only the quotation's id — displaying it is handled in the UI.
update_task_status
ChatGPTMark a task as completed, or change the status of an existing TASK activity. Use this whenever the user asks to complete, close, finish, reopen, or change a task's status — never create_activity or update_activity for that. Only the status is changed.
update_ticket
ChatGPTUpdate fields on an existing support ticket, including escalating it or closing it. Look up the ticket first to get its _id — never guess it. records must contain ONLY the fields actually changing — omit anything unchanged, and never pass null for a field just to keep it as-is. Escalate with escalate=true, or close via records.status="CLOSED".
validate_pipeline
ChatGPTCheck a MongoDB aggregation pipeline's structure before passing it to get_records, get_tickets_aggregate, get_quotations_aggregate, or get_conversations_aggregate. Catches malformed stages (e.g. multiple fields in one stage object, unknown or disallowed stage names) so errors surface before the call instead of as a MongoServerError. This is a structural check only — it does not verify field paths or operator arguments, and does not run the pipeline against real data.
change_quotation_status
Claudecheck_xero_contact_link_tool
Claudecreate_quotation
Claudeget_accessible_modules
Claudeget_activities
Claudeget_associated_records
Claudeget_conversation_users
Claudeget_conversations_aggregate
Claudeget_conversations_aggregate_paginated
Claudeget_crm_users
Claudeget_current_date
Claudeget_exchange_rate
Claudeget_integrations
Claudeget_module_schema
Claudeget_quotation_by_id
Claudeget_quotation_form
Claudeget_quotations_aggregate_paginated
Claudeget_records_paginated
Claudeget_suggestion_params
Claudeget_ticket_info
Claudeget_tickets_aggregate_paginated
Claudeget_xero_contacts
Claudesave_activity
Claudesave_business_record
Claudesave_ticket
Claudesearch_knowledge_base
Claudesync_xero_contact_tool
Claudesync_xero_quote_tool
Claudeupdate_quotation
Claudevalidate_pipeline
Claude