MCP Tools Reference
Complete reference for all MCP tools available to AI agents.
CRM Factory's MCP server exposes 14 tools across three categories: CRM operations, ERP queries, and knowledge search.
CRM Tools
search_crm
Search CRM records by keyword across multiple entity types.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
query | string | Yes | — | Search keyword (min 2 chars) |
types | string[] | No | all types | Filter to specific types: account, contact, opportunity, case, lead |
limit | number | No | 10 | Max results per type (1-50) |
Returns: { query, results: [{ id, type, title, subtitle }] }
Performs case-insensitive substring matching across name, email, subject, and other text fields. Results are merged and capped at limit × 3 total.
get_record
Retrieve a single CRM record with all related entities.
| Parameter | Type | Required | Description |
|---|---|---|---|
type | string | Yes | account, contact, opportunity, case, or lead |
id | string (UUID) | Yes | Record ID |
Returns vary by type:
- account:
{ record, contacts, opportunities, cases, recentActivities } - contact:
{ record, account, opportunities, cases, recentActivities } - opportunity:
{ record, account, contact, products, recentActivities } - case:
{ record, account, contact, comments, recentActivities } - lead:
{ record }
list_records
List CRM records with optional filtering.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
type | string | Yes | — | account, contact, opportunity, case, or lead |
stage | string | No | — | Filter opportunities by stage |
status | string | No | — | Filter cases/leads by status |
priority | string | No | — | Filter cases by priority |
owner_id | string (UUID) | No | — | Filter by assigned owner |
min_amount | number | No | — | Opportunities with amount greater than or equal to value |
max_amount | number | No | — | Opportunities with amount less than or equal to value |
closing_before | string | No | — | Opportunities closing before this date |
limit | number | No | 50 | Max records (1-200) |
Returns: { type, records: [...] }
create_record
Create a new CRM record. Supported types: opportunity, case, activity.
| Parameter | Type | Required | Description |
|---|---|---|---|
type | string | Yes | opportunity, case, or activity |
fields | object | Yes | Fields for the new record (see below) |
Opportunity fields: name (required), stage (default "Discovery"), account_id, contact_id, amount, currency, probability, expected_close_date, pipeline_id
Case fields: subject (required), description, account_id, contact_id, priority (default "medium"), status (default "new"), category
Activity fields: activity_type (required: email/call/meeting/task/note), subject (required), body, due_at, related_to (array of { type, id })
The authenticated user is automatically set as the owner.
update_record
Update fields on an existing CRM record.
| Parameter | Type | Required | Description |
|---|---|---|---|
type | string | Yes | account, contact, opportunity, case, or lead |
id | string (UUID) | Yes | Record ID |
fields | object | Yes | Fields to update (only provided fields are changed) |
Editable fields vary by type. For opportunities: name, stage, amount, probability, expected_close_date, loss_reason, won. For cases: subject, description, status, priority, category.
get_pipeline_summary
Get aggregated pipeline metrics with opportunity count and total value per stage.
| Parameter | Type | Required | Description |
|---|---|---|---|
pipeline_id | string (UUID) | No | Filter to a specific pipeline (default: all pipelines) |
Returns: { pipeline_id, stages: [{ stage, opportunityCount, totalAmount }] }
draft_email
Draft a customer-facing email using CRM context. Uses AI to generate a polished email based on the contact's account, open opportunities, and recent activity.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
contact_id | string (UUID) | Yes | — | Target contact |
purpose | string | Yes | — | What the email is about (min 3 chars) |
tone | string | No | "friendly" | formal, friendly, or casual |
Returns: { to, subjectSuggestion, draft, context: { contactId, accountId, opportunityIds } }
get_call_history
Get recent call activity for a contact or account.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
contact_id | string (UUID) | No* | — | Filter by contact |
account_id | string (UUID) | No* | — | Filter by account |
limit | number | No | 20 | Max results (1-100) |
*At least one of contact_id or account_id is required.
Returns: { calls: [{ id, subject, created_at, completed_at, duration, direction, call_sid, ai_summary }] }
search_call_transcripts
Search call transcripts by keyword.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
query | string | Yes | — | Search keyword (min 2 chars) |
contact_id | string (UUID) | No | — | Scope to contact |
account_id | string (UUID) | No | — | Scope to account |
limit | number | No | 10 | Max results (1-25) |
Returns: { query, results: [{ id, subject, created_at, transcript }] }
get_call_analysis
Get full AI post-call analysis for a single call.
| Parameter | Type | Required | Description |
|---|---|---|---|
activity_id | string (UUID) | Yes | Call activity ID |
Returns: { id, subject, created_at, completed_at, call_sid, transcript, analysis }
The analysis object contains AI-generated insights including summary, action items, and sentiment.
ERP Tools
These tools require an active ERP integration connection (Infor SX, SAP, NetSuite, or Dynamics).
erp_lookup
Lookup ERP data by type.
| Parameter | Type | Required | Description |
|---|---|---|---|
type | string | Yes | account, product, order, order_history, pricing, or customer_kpis |
params | object | Yes | Type-specific parameters (see below) |
- account:
{ account_id?, email?, name?, erp_customer_id? }— Looks up from local synced data - product:
{ sku?, query?, limit? }— Looks up from local synced data - order:
{ order_number }— Live ERP query - order_history:
{ account_id?, customer_id?, limit? }— Live ERP query - pricing:
{ customer_id, sku?, items?: [{ sku, qty? }] }— Live ERP query - customer_kpis:
{ customer_id }— Live ERP query
erp_check_inventory
Check live ERP inventory levels.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
skus | string[] | Yes | — | SKUs to check (1-50) |
warehouse_id | string | No | "main" | Warehouse identifier |
Returns: { skus, inventory: [{ sku, warehouseId, quantityOnHand, quantityAvailable, quantityOnOrder }] }
erp_live_query
Generic live ERP query dispatcher for advanced use cases.
| Parameter | Type | Required | Description |
|---|---|---|---|
action | string | Yes | One of: search_customers, get_customer, get_customer_credit, get_customer_contacts, get_customer_invoices, get_customer_kpis, list_orders, get_order, search_products, get_product, get_inventory, get_pricing, list_warehouses |
params | object | Yes | Action-specific parameters |
Knowledge Tools
search_knowledge
Semantic vector search across the embedded knowledge base.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
query | string | Yes | — | Natural language search query (min 2 chars) |
source_types | string[] | No | all | Filter by source: case, case_comment, activity, email, transcript, product, article, document |
parent_type | string | No | — | Filter by parent entity type |
parent_id | string (UUID) | No | — | Filter by parent entity ID |
limit | number | No | 10 | Max results (1-50) |
min_similarity | number | No | 0.3 | Minimum cosine similarity threshold (0-1) |
Returns: { query, results: [{ id, sourceType, sourceId, parentType, parentId, content, metadata, similarity }] }
Uses pgvector cosine similarity to find the most semantically relevant knowledge chunks. Higher min_similarity values return fewer but more relevant results.