get_customer
Retrieve a complete customer profile including contact details, tags, notes, conversation history, and order information to manage customer relationships.
Instructions
Get detailed customer information.
Returns full customer profile including contact details, tags, notes, conversation history, and order info.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| customer_id | Yes | Customer ID (from list_customers results) | |
| org_id | No | Organization ID (uses YAPARAI_ORG_ID env var if not provided) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/yaparai/tools/crm.py:46-66 (handler)Main handler for the 'get_customer' tool. Takes a customer_id and optional org_id, resolves the org ID, creates a client, and calls the CRM API to get customer details.
async def get_customer( customer_id: str, org_id: str | None = None, ) -> dict: """ Get detailed customer information. Returns full customer profile including contact details, tags, notes, conversation history, and order info. Args: customer_id: Customer ID (from list_customers results) org_id: Organization ID (uses YAPARAI_ORG_ID env var if not provided) Returns: Dict with customer details: name, phone, email, address, tags, notes, platform, avatar_url, created_at, last_interaction. """ oid = resolve_org_id(org_id) client = YaparAIClient() return await client.crm_get_customer(oid, customer_id) - src/yaparai/tools/crm.py:46-49 (schema)Input schema for the tool: requires customer_id (str), accepts optional org_id (str | None), returns a dict.
async def get_customer( customer_id: str, org_id: str | None = None, ) -> dict: - src/yaparai/server.py:170-170 (registration)Registration of get_customer as an MCP tool on the FastMCP server instance. The function is imported from yaparai.tools.crm on line 86.
mcp.tool(get_customer) - src/yaparai/server.py:83-86 (registration)Import of get_customer from the CRM tools module into the server module for registration.
# --- Enterprise: CRM --- from yaparai.tools.crm import ( list_customers, get_customer, - src/yaparai/client.py:283-287 (helper)HTTP client helper that performs a GET request to the CRM customer detail endpoint at /api/enterprise/orgs/{org_id}/crm/customers/{customer_id}.
async def crm_get_customer(self, org_id: str, customer_id: str) -> dict: """Get customer details.""" return await self._request( "GET", f"/api/enterprise/orgs/{org_id}/crm/customers/{customer_id}" )