CRM field mapping

How Agents map a connected CRM into the tenant DataPool model. CRM-native field names must not be written into DataPool rows.

Document information
FieldValue
Canonical URL/docs/07_ai-agents-and-mcp/model_skills/00_shared/crm-field-mapping
Version (published date)2026-08-26
Tagsai, skills, datapool, integrations, playbooks

Kind

Resource guardrails.

When to use

Any CRM read or write that feeds leads or opportunities. Do not use this skill to “summarize the CRM” without mapping.

Depends on

tenant-data-model (install first).

Prerequisites

idquestionsearchif_missing_or_ambiguousdefault_to_proposebinds_to
crm_integration_idWhich tenant integration is the CRM?Load integrations. list_integrations / entity_search for CRM, Espo, Salesforce, HubSpot, or the name the operator used.request_human_input kind: choice with matches, or text if noneNone — must be a real integrationTenant SKILL.md
crm_lead_objectWhat is the CRM object/collection for leads?describe_tenant_integration operations / schemaAskPropose Lead if the connector schema uses that labelTenant SKILL.md
crm_opportunity_objectWhat is the CRM object for deals/opportunities?SameAskPropose Opportunity / Deal from describeTenant SKILL.md
leads_schemaDataPool leads tableFrom installed tenant-data-modelImport tenant-data-model firstBound name from that skillTenant SKILL.md
opportunities_schemaDataPool opportunities tableFrom tenant-data-modelSameBound nameTenant SKILL.md

Import contract

FieldValue
suggested_skill_idcrm-field-mapping
version1.0.0
capabilities.toolsdescribe_tenant_integration, execute_tenant_integration, describe_datapool_table, query_datapool, insert_datapool_rows, update_datapool_rows, request_human_input

Default map (generic B2B)

Trace must replace these CRM-side names with fields from describe_tenant_integration when they differ. Left column is CRM-native (source). Right column is DataPool (target).

Leads → {{leads_schema}}

CRM field (example)DataPool column
id / LeadIdlead_id
company / AccountNamecompany_name
name / FullNamecontact_name
emailcontact_email
source / LeadSourcesource
statusstatus (normalize to new | qualifying | sales_ready | disqualified)
scorescore

Opportunities → {{opportunities_schema}}

CRM field (example)DataPool column
idopportunity_id
lead id / LeadIdlead_id
name / Accountcompany_name
stage / Statusstage (normalize to discovery | proposal | negotiation | won | lost)
amountamount
currencycurrency
close dateclose_date

Unmapped CRM fields stay in a DataPool column only if the operator adds it to tenant-data-model first.

Tenant SKILL.md (copy this body)

# CRM field mapping

Map CRM records into DataPool. Load `integrations` then `datapool`. Load tenant skill `tenant-data-model` when the bound schema names are needed.

## Bound values

- CRM integration id: `{{crm_integration_id}}`
- CRM lead object: `{{crm_lead_object}}`
- CRM opportunity object: `{{crm_opportunity_object}}`
- DataPool leads schema: `{{leads_schema}}`
- DataPool opportunities schema: `{{opportunities_schema}}`

## Sequence

1. `describe_tenant_integration` for `{{crm_integration_id}}`. Do not guess operations.
2. Read CRM only through `execute_tenant_integration` when `executable_by_ai_agents` is enabled; otherwise stop and report the flag.
3. `describe_datapool_table` for `{{leads_schema}}` and `{{opportunities_schema}}`.
4. Translate each CRM field through the map in this playbook (updated at import from describe output). Write DataPool columns only.
5. Normalize `status` / `stage` enumerations. If a CRM value has no mapping, stop; do not invent a stage.

## Stop

- Do not insert CRM-native keys as DataPool column names.
- Do not treat platform Entities as the CRM mirror.
- Do not execute the CRM integration merely to “try it”.

Optional skill.json

{
  "name": "crm-field-mapping",
  "version": "1.0.0",
  "description": "Map CRM fields into canonical DataPool leads and opportunities.",
  "capabilities": {
    "prompt": ["Describe the CRM integration and DataPool tables before mapping. Never copy CRM-native keys into rows."],
    "resources": [],
    "tools": [
      "describe_tenant_integration",
      "execute_tenant_integration",
      "describe_datapool_table",
      "query_datapool",
      "insert_datapool_rows",
      "update_datapool_rows",
      "request_human_input"
    ]
  }
}

See also