PluginWorks in Claude CodeCurrent
Intercom
Intercom integration for Claude Code. Search conversations, analyze customer support patterns, look up contacts and companies, and install the Intercom Messenger. Connect your Intercom workspace to get real-time insights from customer data.
0
Try it
See what this would do for you. No sign-up needed.
Install in Claude Code
Run these in Claude Code, in order. The first adds the marketplace, the second installs the plugin.
Step 1
/plugin marketplace add anthropics/claude-plugins-official
Step 2
/plugin install intercom@claude-plugins-official
Review commands before running them. Promptu never runs code on your machine or pushes changes to your repo.
What's inside
4 skills
- customer-360
- install-cli
- install-messenger
- intercom-analysis
1 MCP server
Security scan
Flagged
Promptu's text scan flagged something in this plugin. Read its files before you install it.
credential-access in skills/install-cli/SKILL.md:63; sudo in skills/install-cli/SKILL.md:42
Details
# Intercom Plugin for Claude Code
Connect your Intercom workspace to Claude Code. Search conversations, analyze customer support patterns, look up contacts and companies, and install the Intercom Messenger — all from your terminal.
## Prerequisites
- An [Intercom](https://www.intercom.com) workspace
- [Claude Code](https://docs.anthropic.com/en/docs/claude-code) CLI installed
- Your Intercom workspace must be US-hosted (EU and AU support coming soon)
## Installation
```
/plugin install intercom
```
## Available Skills
| Skill | Invocation | Description |
|-------|-----------|-------------|
| **Intercom Analysis** | Auto-triggered | Analyze conversations, find support patterns, investigate customer issues, and look up contacts. Triggers automatically when you ask about your Intercom data. |
| **Install Messenger** | `/intercom:install-messenger [framework]` | Install the Intercom Messenger with secure JWT-based identity verification. Supports React, Next.js, Vue.js, and plain JavaScript. |
| **Install CLI** | `/intercom:install-cli` | Install and authenticate the [`@intercom/cli`](https://www.npmjs.com/package/@intercom/cli) command-line tool for shell access, scripting, and workspace provisioning. |
| **Customer 360** | `/intercom:customer-360 [email or company]` | Build a comprehensive customer profile with conversation history, account context, and interaction timeline. |
## Usage Examples
**Analyze recent support trends:**
```
Show me the most common topics in open conversations this week
```
**Investigate a customer issue:**
```
Look up all conversations from jane@example.com and summarize her issues
```
**Build a customer profile:**
```
/intercom:customer-360 jane@example.com
```
**Install the Messenger:**
```
/intercom:install-messenger react
```
**Install the CLI:**
```
/intercom:install-cli
```
**Get conversation details:**
```
Pull up conversation #12345 and show me the full thread
```
## Access & Limitations
- **Safe, read-only access** — The plugin can search and retrieve data but cannot create, update, or delete conversations, contacts, or other Intercom objects. Your workspace data is never modified.
- **US region only** — Currently supports US-hosted Intercom workspaces. EU and Australia region support is planned.
- **Rate limits** — Search operations are subject to Intercom API rate limits. The MCP server handles throttling automatically.
## Resources
- [Intercom Developer Hub](https://developers.intercom.com)
- [Intercom API Reference](https://developers.intercom.com/docs/references/rest-api/api.intercom.io/conversations/conversation/)
- [Intercom Messenger Setup Guide](https://www.intercom.com/help/en/articles/170-install-intercom-on-your-website-or-web-app)
- [Claude Code Documentation](https://docs.anthropic.com/en/docs/claude-code)
## License
MIT — see [LICENSE](LICENSE) for details.
## skills/customer-360/SKILL.md
---
name: customer-360
license: MIT
description: >
Build a comprehensive customer profile from Intercom data, including
conversation history, account context, and interaction timeline. Use when
the user asks to "look up a customer", "customer profile", "customer 360",
"tell me about this customer", "summarize a customer's history", or provides
a customer email or company name and wants a full picture.
disable-model-invocation: true
argument-hint: "[email or company name]"
---
# Customer 360
Produce a comprehensive customer profile by aggregating data from across the Intercom workspace.
## Workflow
### Step 1: Identify the Customer
- Parse the user's input for an email, name, or company
- Use `search_contacts` to find the contact (by email is most reliable)
- If company name given, search contacts by email domain
- Use `get_contact` to fetch the full profile (attributes, tags, segments, companies)
### Step 2: Gather Conversation History
- Use `search_conversations` filtered to this contact's conversations
- Paginate to get all conversations (not just the first page)
- For the most recent/relevant conversations, use `get_conversation` for full threads
### Step 3: Build the Profile
Produce a markdown profile with these sections:
#### Contact Summary
- Name, email, role (user/lead), company
- Location, timezone, last seen
- Plan/tier (if available via custom attributes)
- Tags and segments
#### Conversation History
- Total conversation count
- Table: ID | Subject | State | Channel | Date
- Highlight any currently open/snoozed conversations
#### Key Themes
- Common topics across conversations
- Recurring issues or feature requests
- Sentiment signals (escalations, positive feedback)
#### Timeline
- Chronological list of significant interactions
- First contact → most recent activity
#### Open Items
- Unresolved conversations
- Pending questions or follow-ups
### Step 4: Present and Offer Next Steps
- Present the profile
- Offer to dive deeper into any conversation
- Offer to search for similar customers (same company, same issues)
## Best Practices
- Always cite conversation IDs so the user can find them in the Intercom inbox
- Note data freshness — states may have changed since events occurred
- If the contact has many conversations, summarize the most recent 10-15 and note the total count
- Handle cases where the contact exists but has no conversations
## Troubleshooting
### Contact Not Found
Symptom: No results for the provided email or name.
Solution: Check for typos. Try searching by email domain to find related contacts. Ask the user to confirm the identifier.
### Too Many Conversations
Symptom: Contact has 50+ conversations, making full analysis impractical.
Solution: Focus on the most recent 10-15 conversations. Summarize older ones by theme rather than individually. Note the total count.
## skills/install-cli/SKILL.md
---
name: install-cli
license: MIT
description: >
Install and authenticate the Intercom CLI (`@intercom/cli`) — a command-line
tool for managing Intercom workspaces, designed for both human operators
and AI agents. Use when the user asks to "install the Intercom CLI",
"set up the intercom command", "install @intercom/cli", or wants
shell access to their Intercom workspace.
disable-model-invocation: true
---
# Install Intercom CLI
Install the [`@intercom/cli`](https://www.npmjs.com/package/@intercom/cli) package globally and authenticate it against the user's workspace. The CLI complements this plugin: the plugin is for in-conversation MCP usage, while the CLI is for shell access, scripting, and workspace provisioning.
## Prerequisites
Before installing, verify the user has:
1. **Node.js >= 20.6.0** — Run `node --version` to check. If missing or older, direct them to install via [nodejs.org](https://nodejs.org) or their version manager (nvm, fnm, volta).
2. **npm** — Comes bundled with Node.
If `node --version` returns < 20.6.0, stop and ask the user to upgrade before proceeding. The CLI will not run on older versions.
## Step 1: Install Globally
```bash
npm install -g @intercom/cli
```
Verify the install:
```bash
intercom --version
```
If the user gets a permission error (`EACCES`) on macOS or Linux, they likely have a system Node install. Recommend either:
- Switching to a user-managed Node via nvm/fnm/volta (preferred), or
- Configuring an [npm prefix](https://docs.npmjs.com/cli/v10/configuring-npm/folders#prefix-configuration) under their home directory.
Do **not** suggest `sudo npm install -g` — installing global packages as root is a known footgun and will cause permissions issues on later updates.
## Step 2: Authenticate
There are two paths. Ask the user which applies.
### Path A: Existing Workspace (most common)
The user has an Intercom workspace and needs to connect the CLI to it.
1. Direct them to the [Developer Hub](https://app.intercom.com/a/apps/_/developer-hub).
2. Click **New app** (or select an existing app).
3. Under **Authentication**, copy the **Access Token**.
4. Authenticate one of two ways:
**Option 1 — Persistent (recommended for interactive use):**
```bash
intercom auth login --token "<paste-token-here>"
```
This stores the token in the OS keyring (Keychain on macOS, Secret Service on Linux, Credential Manager on Windows) so future commands don't need the env var.
**Option 2 — Environment variable (recommended for CI / scripting):**
```bash
export INTERCOM_TOKEN="<paste-token-here>"
```
Add this to `~/.zshrc`, `~/.bashrc`, or the equivalent so it persists across shells. For CI, set it as a secret in the pipeline config.
The env var takes precedence over the keyring-stored credential when both are present.
### Path B: New Workspace (provisioning)
The user wants to create a brand-new Intercom workspace from scratch — no token needed.
```bash
intercom setup --company-name "Acme"
```
This command provisions a workspace, signs the user in, and stores the resulting credentials. The CLI will prompt for an email, password, and verification code during the flow.
If the user has additional setup needs (importing articles, enabling Fin, etc.), point them at:
```bash
intercom setup --help
```
## Step 3: Verify
Run:
```bash
intercom me
```
Expected output: the admin's name, email, and the active workspace ID. If this fails:
| Error | Likely Cause | Fix |
|-------|--------------|-----|
| `Not authenticated` | No token in keyring or env | Re-run Step 2 |
| `401 Unauthorized` | Token revoked or wrong workspace | Generate a new token in the Developer Hub |
| `command not found: intercom` | Global install path not on `$PATH` | Run `npm config get prefix`, ensure `<prefix>/bin` is on `$PATH` |
## Step 4 (Optional): Shell Completions
Recommend this only if the user uses `intercom` interactively in their shell.
```bash
# zsh — append to ~/.zshrc
intercom completion zsh >> ~/.zshrc
# bash — append to ~/.bashrc
intercom completion bash >> ~/.bashrc
# fish
intercom completion fish > ~/.config/fish/completions/intercom.fish
```
Restart the shell or `source` the rc file for completions to take effect.
## Quick Reference
After install, the user can run any of these. Don't dump this whole list at them — surface relevant commands based on their goal.
| Command | Purpose |
|---------|---------|
| `intercom me` | Show current admin + workspace |
| `intercom api <endpoint>` | Raw API access (like `gh api`) |
| `intercom articles list\|get\|search` | Help center articles |
| `intercom contacts list\|get\|search` | Contacts |
| `intercom conversations list\|get\|search` | Conversations |
| `intercom fin manifest\|enable\|download` | Fin AI Agent |
| `intercom messenger get\|update\|snippet` | Messenger config |
| `intercom config list` | Show CLI config |
Full reference: [`@intercom/cli` README](https://github.com/intercom/cli#readme).
## Agent / Pipe Mode
The CLI auto-detects when stdout is piped and switches to compact NDJSON (one JSON object per line). This makes it ergonomic for scripts and AI agents:
```bash
# Auto NDJSON when piped
intercom articles list | jq '.title'
# Force JSON
intercom articles list --json
# Inline jq filter
intercom articles list --jq '.data[].title'
```
If the user is using the CLI from a Claude Code agent or other automation, prefer `--json` or `--jq` over parsing human-formatted output.
## Multi-Workspace
If the user manages multiple workspaces:
```bash
intercom auth list # show stored credentials
intercom auth switch <workspace> # change default
intercom me --workspace <id> # one-off override
```
Each workspace's credential is stored separately in the keyring.
## Troubleshooting
### `npm install -g` Hangs or Fails on Corporate Network
The user's npm registry may be proxied. Check `npm config get registry` — if it points at an internal mirror, that mirror may not have `@intercom/cli` published. Set the registry explicitly for this install:
```bash
npm install -g @intercom/cli --registry=https://registry.npmjs.org
```
### `intercom` Command Found But Crashes Immediately
Usually a Node version mismatch. Run `node --version` and confirm it's >= 20.6.0. If using nvm, ensure the active version (`nvm current`) is the one the global install used.
### Token Stored But Commands Still Fail With 401
The `INTERCOM_TOKEN` env var overrides the keyring. Run `unset INTERCOM_TOKEN` and try again — a stale env var may be shadowing a fresh keyring credential.
### Wrong Region (EU / Australia)
The CLI defaults to the US API. If the workspace is hosted in EU or Australia:
```bash
export INTERCOM_API_BASE_URL="https://api.eu.intercom.io" # EU
export INTERCOM_API_BASE_URL="https://api.au.intercom.io" # Australia
```
Set this in the shell rc file alongside the token.
## skills/install-messenger/SKILL.md
---
name: install-messenger
license: MIT
description: >
Install the Intercom Messenger on a website or web application with
secure JWT-based identity verification. Generates backend and frontend
code for React, Next.js, Vue.js, Angular, Ember, and plain JavaScript.
Supports Node.js, Python (Flask/Django), PHP, and Ruby backends. Use when
the user asks to "install Intercom", "add the Intercom Messenger", "set up
Intercom chat widget", "add customer chat to my website", or "integrate Intercom".
disable-model-invocation: true
argument-hint: "[framework]"
---
# Install Intercom Messenger
Help the user install the Intercom Messenger on their website or application with JWT-based identity verification. This is the secure default — it prevents user impersonation by cryptographically signing user identity on the server.
Only use the insecure (non-JWT) installation if the user explicitly asks for an "insecure installation". Never default to it.
## Requirements
Gather these from the user before proceeding:
1. **Workspace ID** (also called App ID) — A short alphanumeric string like `abc12345`.
- Found on the [Intercom Messenger install page](https://app.intercom.com/a/apps/_/settings/channels/messenger/install)
- Or in the URL bar: `https://app.intercom.com/a/apps/<workspace_id>/...`
2. **Identity Verification Secret** (also called Messenger API Secret) — Found on the [Messenger Security page](https://app.intercom.com/a/apps/_/settings/channels/messenger/security). This is the HMAC secret used to sign JWTs. It must never appear in frontend code.
Ask the user for both values. Do not proceed without the Workspace ID. If they don't have the Identity Verification Secret yet, direct them to the [Messenger Security page](https://app.intercom.com/a/apps/_/settings/channels/messenger/security) to enable it.
In all generated code, replace `YOUR_WORKSPACE_ID` with the user's actual Workspace ID. Do not leave placeholders — substitute the real values they provided.
## Installation Overview
The secure installation has two parts:
1. **Backend**: Create an API endpoint that generates a signed JWT for the current authenticated user
2. **Frontend**: Boot the Messenger with the JWT from the backend
Always implement both parts. The backend generates the JWT; the frontend passes it to the Messenger.
## Step 1: Backend — JWT Generation Endpoint
Create a server-side endpoint that the frontend calls to get a signed JWT for the currently authenticated user. The JWT must be signed with **HS256** using the Identity Verification Secret.
### Required JWT Claims
| Claim | Required | Description |
|-------|----------|-------------|
| `user_id` | Yes | Stable, unique identifier for the user. Must match across sessions. |
| `email` | Recommended | User's email address |
| `name` | Recommended | User's display name |
| `exp` | Recommended | Expiration timestamp (Unix seconds). Use short-lived tokens — 2 hours is reasonable. |
**Important**: `user_id` is mandatory. If multiple users share the same email and you only pass `email` without `user_id`, Intercom will reject the request with a conflict error.
### Node.js / Express Example
```javascript
const jwt = require('jsonwebtoken');
const INTERCOM_SECRET = process.env.INTERCOM_IDENTITY_SECRET; // Never hardcode this
app.get('/api/intercom-jwt', requireAuth, (req, res) => {
const token = jwt.sign(
{
user_id: req.user.id,
email: req.user.email,
name: req.user.name,
exp: Math.floor(Date.now() / 1000) + (2 * 60 * 60), // 2 hours
},
INTERCOM_SECRET,
{ algorithm: 'HS256' }
);
res.json({ token });
});
```
For Python (Flask/Django), PHP, and Ruby/Rails examples, see `references/backend-examples.md`. The pattern is identical across languages.
Adapt the example to the user's backend language and framework. The key requirements are:
- The endpoint is authenticated (only the logged-in user can get their own JWT)
- The secret comes from an environment variable, never hardcoded
- The token includes `user_id` and has a short expiration
## Step 2: Frontend — Boot Messenger with JWT
The frontend fetches the JWT from the backend and passes it to the Messenger via `intercom_user_jwt`.
### Basic JavaScript (No Framework)
Add before the closing `</body>` tag:
```html
<script>
// Fetch JWT from your backend, then boot the Messenger
fetch('/api/intercom-jwt', { credentials: 'include' })
.then(res => res.json())
.then(({ token }) => {
window.Intercom('boot', {
app_id: 'YOUR_WORKSPACE_ID',
intercom_user_jwt: token,
});
});
</script>
<script>
(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',w.intercomSettings);}else{var d=document;var i=function(){i.c(arguments);};i.q=[];i.c=function(args){i.q.push(args);};w.Intercom=i;var l=function(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/YOUR_WORKSPACE_ID';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);};if(document.readyState==='complete'){l();}else if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})();
</script>
```
### Anonymous Visitors
For unauthenticated pages, boot without a JWT: `Intercom('boot', { app_id: 'YOUR_WORKSPACE_ID' })`. Intercom tracks anonymous visitors as leads.
## Framework-Specific Installation
If the user is using React, Next.js, Vue.js, Angular, Ember, or another SPA framework, refer to `references/framework-guides.md` for JWT-integrated installation code. Ask the user what framework they are using if it is not obvious from their codebase.
After reading the framework guide, adapt the code to the user's specific project structure — find their main layout component, app entry point, or equivalent, and integrate the Messenger there.
## Regional Data Centers
Most Intercom workspaces are in the US region, which is the default — no `api_base` is needed. Only add `api_base` if the user's workspace is hosted in EU or Australia:
| Region | `api_base` | Required? |
|--------|------------|-----------|
| US (default) | *(not needed)* | No |
| EU (Ireland) | `https://api-iam.eu.intercom.io` | Yes |
| Australia | `https://api-iam.au.intercom.io` | Yes |
If the user mentions EU or Australian hosting, GDPR compliance, or data residency requirements, add the appropriate `api_base` to every `Intercom('boot', ...)` call. Otherwise, omit it.
## Security Best Practices
### Logout and Shutdown
When a user logs out, shut down the Messenger to clear session cookies and prevent data leakage:
```javascript
// Call this in your logout handler, BEFORE clearing session data
Intercom('shutdown');
```
After shutdown, re-initialize for the next user or as anonymous:
```javascript
Intercom('boot', {
app_id: 'YOUR_WORKSPACE_ID',
});
```
Always include the shutdown call. Skipping it leaks conversation data between users on shared devices.
### Token Expiration
Set short JWT expiration times — two hours is a good default. To refresh an expired token, re-fetch the JWT from the backend and call `Intercom('boot', ...)` again with the new token.
## Troubleshooting
### JWT Library Not Installed
Error: `Cannot find module 'jsonwebtoken'` (Node.js), `ModuleNotFoundError: No module named 'jwt'` (Python), or `LoadError: cannot load such file -- jwt` (Ruby)
Solution: Install the JWT library for the user's language — `npm install jsonwebtoken`, `pip install PyJWT`, or `gem install jwt`.
### Wrong Identity Verification Secret
Symptom: Messenger loads but shows "Identity verification failed" or user attributes don't appear.
Cause: The secret used to sign JWTs doesn't match the workspace's Identity Verification Secret.
Solution: Verify the secret on the [Messenger Security page](https://app.intercom.com/a/apps/_/settings/channels/messenger/security). Ensure the environment variable holds the correct value for this workspace.
### Plan Doesn't Support Identity Verification
Symptom: Identity Verification Secret not available in Intercom settings.
Cause: Identity verification is a paid feature not available on all Intercom plans.
Solution: Check the workspace's Intercom plan on the [Messenger Security page](https://app.intercom.com/a/apps/_/settings/channels/messenger/security). If identity verification is unavailable, the user may need to upgrade or use the insecure installation (with explicit acknowledgment of the security trade-off).
### JWT `exp` in the Past
Symptom: Messenger rejects the token immediately after creation.
Cause: Server clock is wrong or `exp` calculation is incorrect.
Solution: Check the server's system time (`date` command). Ensure NTP is configured. Verify the `exp` value is a future Unix timestamp in seconds (not milliseconds).
### CORS Errors on JWT Endpoint
Symptom: Browser console shows `Access-Control-Allow-Origin` errors when fetching the JWT.
Cause: The backend JWT endpoint doesn't allow requests from the frontend's origin.
Solution: Configure CORS on the JWT endpoint to allow the frontend origin. For Express: `cors({ origin: 'https://your-app.com', credentials: true })`. For other frameworks, add the appropriate CORS headers.
## Single-Page App (SPA) Route Changes
In SPAs, call `Intercom('update')` after each client-side route change. See `references/framework-guides.md` for framework-specific placement (React Router, Next.js, Vue Router, Angular, Ember).
## Third-Party Integrations
Intercom also supports code-free installation via WordPress, Shopify, Google Tag Manager, and Segment. Direct users to the [Messenger install page](https://app.intercom.com/a/apps/_/settings/channels/messenger/install) for setup instructions.
## Verifying the Installation
After generating the code, verify the installation before considering the task complete.
**With browser automation** (Playwright MCP, playwright-cli, etc.): Navigate to the app, confirm `typeof window.Intercom === 'function'`, check the script tag for `widget.intercom.io/widget/WORKSPACE_ID`, and verify the JWT endpoint returns HTTP 200 with `{ "token": "..." }` for an authenticated user. Note: in headless/sandboxed environments, the widget iframe may not load due to CDN restrictions — this is not a code problem.
**With Intercom MCP tools** (`search_contacts`): After a user logs in and loads a page with the Messenger, search for the user by name or `external_id`. Confirm the contact exists with `role: "user"` and the correct `external_id` — this proves the full chain from JWT signing to Intercom identity creation.
**Manual verification** (instruct the user): Open the app in a browser, confirm the Messenger bubble appears, log in, click the bubble, send a test message, then check the [Intercom Inbox](https://app.intercom.com/a/inbox/_/inbox/) to confirm the conversation appears attributed to the correct user.
## Post-Installation: Enforce JWT Authentication
After the code is deployed, the user must enable and enforce identity verification in Intercom. Direct them to complete these steps:
1. Go to the [Messenger Security page](https://app.intercom.com/a/apps/_/settings/channels/messenger/security)
2. **Enable Identity Verification** if not already enabled — this activates JWT-based authentication for the Messenger
3. **Enforce Identity Verification** — once enabled and confirmed working, switch to "Enforced" mode so that unauthenticated Messenger sessions are rejected
4. **Mark identifying attributes as protected** — on the same page, mark attributes like email, phone, and account IDs as protected so only server-signed JWTs can set them
This is a critical step. Without enforcement, the JWT signing is optional and users can still be impersonated via the browser console. Enforcement ensures only server-signed identities are accepted.
## Insecure Installation (Only If Explicitly Requested)
If the user explicitly asks for an "insecure installation" (no JWT, no identity verification), provide the basic snippet that passes user attributes directly in `intercomSettings` without server-side signing:
```html
<script>
window.intercomSettings = {
app_id: "YOUR_WORKSPACE_ID",
name: "Jane Doe",
email: "jane@example.com",
created_at: 1312182000
};
</script>
<script>
(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',w.intercomSettings);}else{var d=document;var i=function(){i.c(arguments);};i.q=[];i.c=function(args){i.q.push(args);};w.Intercom=i;var l=function(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/YOUR_WORKSPACE_ID';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);};if(document.readyState==='complete'){l();}else if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})();
</script>
```
Warn the user that this is insecure: anyone can impersonate any user by modifying the `email` or `name` values in the browser console. Recommend switching to JWT-based authentication for production use.
## skills/intercom-analysis/SKILL.md
---
name: intercom-analysis
license: MIT
description: >
Analyze Intercom conversations to identify support patterns, investigate
customer issues, and look up contacts and companies. Use when the user asks
to "analyze conversations", "find support patterns", "search Intercom",
"look up a customer", "investigate a customer issue", "check contact info",
or asks questions about their Intercom data.
---
# Intercom Analysis
Use the Intercom MCP server to analyze customer conversations, look up contacts and companies, identify support patterns, and investigate customer issues.
Refer to `references/mcp-tools.md` for detailed tool reference, query DSL syntax, search strategies, and field-level documentation for each MCP tool.
## Pattern Analysis Workflow
When the user asks to analyze patterns or trends in their support data, follow this workflow:
1. **Define scope.** Clarify what the user wants to analyze — a time period, topic, customer segment, or conversation state. Ask if unclear.
2. **Fetch a representative sample.** Search for conversations matching the scope. Retrieve at least 10–20 conversations to establish meaningful patterns. Paginate if the first page is insufficient.
3. **Read conversation details.** For each relevant conversation, fetch the full conversation to read the actual messages. Summaries from search results alone are often insufficient for pattern analysis.
4. **Identify recurring themes.** Group conversations by:
- Common topics or keywords
- Product areas or features mentioned
- Error messages or symptoms reported
- Resolution approaches used
- Time to resolution
5. **Quantify and summarize.** Present findings with counts and proportions (e.g., "8 of 15 conversations mention timeout errors"). Highlight the most common patterns first.
6. **Recommend actions.** Based on patterns, suggest concrete next steps — knowledge base articles to create, bugs to investigate, or process improvements.
**Output artifact:** Produce a markdown report with the following structure:
- **Theme Summary** — Table of identified themes with conversation counts and percentage of total
- **Top Issues** — The 3–5 most common issues with representative conversation excerpts
- **Recommended Actions** — Prioritized list of concrete next steps based on the patterns found
## Issue Investigation Steps
When a user asks you to investigate a specific customer issue or incident:
1. **Identify the customer.** Look up the contact by email, name, or ID. Get their full profile to understand their account context (plan, company, location, custom attributes).
2. **Trace the timeline.** Search for all conversations from this contact, ordered by date. Fetch each conversation to build a chronological narrative of their interactions.
3. **Check for multi-customer impact.** Search for conversations from other contacts mentioning the same symptoms, error messages, or affected feature. This determines if the issue is isolated or widespread.
4. **Examine conversation details.** For the most relevant conversations, read through the full thread including internal notes. Notes from teammates often contain diagnostic information and root cause analysis.
5. **Summarize findings.** Present:
- A timeline of the customer's interactions
- The core issue and any error messages
- What was tried and what resolved it (if anything)
- Whether other customers are affected
- Links to the relevant conversations
**Output artifact:** Produce a timeline summary with:
- **Customer Context** — Contact details, company, plan, and account attributes
- **Interaction Timeline** — Chronological list of conversations with dates, channels, and outcomes
- **Impact Assessment** — Whether the issue affects other customers, with links to related conversations
## Best Practices
- **Start broad, then narrow.** Begin with a general search to understand the landscape, then apply filters to focus on what matters.
- **Always cite conversation links.** When referencing specific conversations, include their IDs so the user can find them in the Intercom inbox. Format as: `Conversation #12345`.
- **State data limitations.** If search results are paginated and you've only seen the first page, say so. If the data doesn't support a conclusion, be explicit about what would be needed to confirm it.
- **Respect data freshness.** The MCP server returns live data from the Intercom workspace. Results reflect the current state — if the user asks about historical trends, note that conversation states may have changed since the events occurred.
- **Combine tools effectively.** A typical workflow involves `search` or `search_conversations` to find relevant items, then `get_conversation` or `get_contact` to get full details. Don't try to answer complex questions from search results alone.
- **Handle empty results gracefully.** If a search returns no results, suggest alternatives: broaden the query with fewer or different keywords, try a different object type (contacts instead of conversations, or vice versa), check for typos in email addresses or names, or run an unfiltered search first to confirm data exists.
- **Format search results for scannability.** Present results as clean tables. For conversations: ID | Subject | State | Last Updated (with relative timestamps). For contacts: ID | Name | Email | Last Seen. After displaying results, offer to fetch full details (e.g., "Want me to pull up the full thread for conversation #12345?" or "I can get the complete profile — want to see it?").
## Troubleshooting
### MCP Server Disconnected
Error: Tool calls fail with connection/timeout errors
Cause: MCP server unreachable or authentication expired
Solution: Re-authenticate, check network, try again later
### Search Returns 0 Results
Error: Empty result set when matches expected
Cause: Query too narrow, wrong field names, or no matching data
Solution: Broaden filters, try different object type, run unfiltered search first
### Workspace Has No Conversations
Error: All conversation searches return empty
Cause: New/unused workspace or access scope limitation
Solution: Confirm workspace has data, try contact/company searches instead

