# How to integrate Agencyzoom MCP with LangChain

```json
{
  "title": "How to integrate Agencyzoom MCP with LangChain",
  "toolkit": "Agencyzoom",
  "toolkit_slug": "agencyzoom",
  "framework": "LangChain",
  "framework_slug": "langchain",
  "url": "https://composio.dev/toolkits/agencyzoom/framework/langchain",
  "markdown_url": "https://composio.dev/toolkits/agencyzoom/framework/langchain.md",
  "updated_at": "2026-05-12T10:00:22.481Z"
}
```

## Introduction

This guide walks you through connecting Agencyzoom to LangChain using the Composio tool router. By the end, you'll have a working Agencyzoom agent that can add a note to a specific customer profile, batch create five new insurance leads, change the status of a lead to won through natural language commands.
This guide will help you understand how to give your LangChain agent real control over a Agencyzoom account through Composio's Agencyzoom MCP server.
Before we dive in, let's take a quick look at the key ideas and tools involved.

## Also integrate Agencyzoom with

- [OpenAI Agents SDK](https://composio.dev/toolkits/agencyzoom/framework/open-ai-agents-sdk)
- [Claude Agent SDK](https://composio.dev/toolkits/agencyzoom/framework/claude-agents-sdk)
- [Claude Code](https://composio.dev/toolkits/agencyzoom/framework/claude-code)
- [Claude Cowork](https://composio.dev/toolkits/agencyzoom/framework/claude-cowork)
- [Codex](https://composio.dev/toolkits/agencyzoom/framework/codex)
- [OpenClaw](https://composio.dev/toolkits/agencyzoom/framework/openclaw)
- [Hermes](https://composio.dev/toolkits/agencyzoom/framework/hermes-agent)
- [CLI](https://composio.dev/toolkits/agencyzoom/framework/cli)
- [Google ADK](https://composio.dev/toolkits/agencyzoom/framework/google-adk)
- [Vercel AI SDK](https://composio.dev/toolkits/agencyzoom/framework/ai-sdk)
- [Mastra AI](https://composio.dev/toolkits/agencyzoom/framework/mastra-ai)
- [LlamaIndex](https://composio.dev/toolkits/agencyzoom/framework/llama-index)
- [CrewAI](https://composio.dev/toolkits/agencyzoom/framework/crew-ai)

## TL;DR

Here's what you'll learn:
- Get and set up your OpenAI and Composio API keys
- Connect your Agencyzoom project to Composio
- Create a Tool Router MCP session for Agencyzoom
- Initialize an MCP client and retrieve Agencyzoom tools
- Build a LangChain agent that can interact with Agencyzoom
- Set up an interactive chat interface for testing

## What is LangChain?

LangChain is a framework for developing applications powered by language models. It provides tools and abstractions for building agents that can reason, use tools, and maintain conversation context.
Key features include:
- Agent Framework: Build agents that can use tools and make decisions
- MCP Integration: Connect to external services through Model Context Protocol adapters
- Memory Management: Maintain conversation history across interactions
- Multi-Provider Support: Works with OpenAI, Anthropic, and other LLM providers

## What is the Agencyzoom MCP server, and what's possible with it?

The Agencyzoom MCP server is an implementation of the Model Context Protocol that connects your AI agent and assistants like Claude, Cursor, etc directly to your Agencyzoom account. It provides structured and secure access to your agency's sales and client management data, so your agent can create leads, manage tasks, update opportunities, take notes, and analyze performance automatically on your behalf.
- Batch contact and lead creation: Quickly add multiple new contacts or leads to your Agencyzoom CRM in a single step to keep your pipeline growing efficiently.
- Automated task management: Let your agent mark tasks as completed or delete batches of tasks, helping your team stay organized and focused on priorities.
- Lead status and opportunity updates: Easily update a lead's lifecycle status or add new sales opportunities, enabling your sales process to move forward without manual intervention.
- Intelligent note-taking: Add detailed notes to customer profiles or leads automatically, ensuring important context is always captured and accessible.
- Opportunity driver management: Create and associate driver records with opportunities to maintain complete and compliant records for insurance sales workflows.

## Supported Tools

| Tool slug | Name | Description |
|---|---|---|
| `AGENCYZOOM_AUTHENTICATE_FOR_JWTVIA_V4_SSO` | Authenticate for JWT via V4 SSO | Completes AgencyZoom V4 Single Sign-On (SSO) authentication by exchanging an OAuth2 authorization code for a JWT token. Prerequisites: First call get_auth_url_for_v4sso to obtain the authentication URL, then redirect the user to that URL for login. After successful authentication through Vertafore's OAuth provider, the callback will include a 'code' parameter. Use that code with this action to obtain the JWT token for API access. Note: This is typically used during initial authentication setup. The code is single-use, time-limited, and must match the PKCE challenge from the original auth request. |
| `AGENCYZOOM_BATCH_CREATE_CONTACT` | Batch create contacts | Creates 1 to 5 new contacts in AgencyZoom in a single batch API call. |
| `AGENCYZOOM_BATCH_CREATE_LEAD` | Batch create leads | Creates up to 5 new leads in AgencyZoom; all referenced entity IDs (e.g., pipeline, user, custom field names) must exist, and organization `name` is required if `isBusiness` is true. |
| `AGENCYZOOM_BATCH_DELETE_TASK` | Batch delete tasks | Deletes multiple AgencyZoom tasks in a batch; task deletion is permanent and the response indicates overall batch success, not individual task status. |
| `AGENCYZOOM_CHANGE_STATUS_FOR_LEAD` | Change lead status | Updates a lead's lifecycle status (e.g., Active, Won, Lost, X-Dated) and can optionally manage its workflow, pipeline, stage, source, or associated tags. |
| `AGENCYZOOM_COMPLETE_TASK` | Mark task as completed | Marks an existing and accessible task in AgencyZoom as 'completed'; this action does not return the full updated task object. |
| `AGENCYZOOM_CREATE_A_CUSTOMER_NOTE` | Create a customer note | Adds a new note to an existing customer's profile using their ID; cannot be used to edit or retrieve existing notes. |
| `AGENCYZOOM_CREATE_A_DRIVER_FOR_AN_OPPORTUNITY` | Create a driver for an opportunity | Creates a new driver record associated with an existing AgencyZoom opportunity using its ID; requires firstName and lastName, with optional fields for additional driver details. |
| `AGENCYZOOM_CREATE_A_LEAD_NOTE` | Create a lead note | Adds a new note to an existing lead in AgencyZoom, identified by `leadId`. |
| `AGENCYZOOM_CREATE_A_LEAD_OPPORTUNITY` | Create a lead opportunity | Adds a new sales opportunity to an existing lead in AgencyZoom, requiring a valid `leadId`, `carrierId`, `productLineId`, and that custom field names match existing definitions in AgencyZoom. |
| `AGENCYZOOM_CREATE_A_LEAD_QUOTE` | Create a lead quote | Creates a new insurance quote for an existing lead in AgencyZoom, using valid carrier and product line IDs, to track a proposal; this action does not bind policies or process payments. |
| `AGENCYZOOM_CREATE_AN_OPPORTUNITY` | Create an opportunity | Creates a new lead opportunity in AgencyZoom; this action cannot update existing opportunities. |
| `AGENCYZOOM_CREATE_A_VEHICLE_FOR_AN_OPPORTUNITY` | Create a vehicle for an opportunity | Adds a new vehicle record to a specified opportunity; `opportunityId` must refer to a valid, existing opportunity. |
| `AGENCYZOOM_CREATE_BIZ_LEAD` | Create business lead | Creates or updates a business lead in AgencyZoom using detailed personal and company information, for B2B sales and marketing lead management. |
| `AGENCYZOOM_CREATE_LEAD` | Create lead | Creates a new lead or updates an existing one in AgencyZoom; ensure `pipelineId`, `stageId`, `leadSourceId`, and `assignTo` reference valid, existing entities. |
| `AGENCYZOOM_CREATE_TASK` | Create task post endpoint | Creates a new task in AgencyZoom; ensure `assigneeId`, `customerId`, or `leadId` are valid existing entities if provided, and use `contactEmail`, `customerId`, or `leadId` to link the task to a contact. |
| `AGENCYZOOM_DELETE_A_CUSTOMER` | Delete a customer | Irreversibly deletes a customer and all associated data in AgencyZoom using their `customerId`; useful for offboarding or data privacy compliance. |
| `AGENCYZOOM_DELETE_A_CUSTOMER_FILE` | Delete customer file | Permanently deletes a specific file, identified by `fileId`, associated with a customer, identified by `customerId`. |
| `AGENCYZOOM_DELETE_A_CUSTOMER_POLICY` | Delete a customer policy | Permanently deletes a specific policy associated with a customer, for instance, if it's cancelled or inactive; this action is irreversible and requires caution. |
| `AGENCYZOOM_DELETE_A_DRIVER` | Delete an opportunity driver by ID | Permanently deletes an existing driver record (a person associated with an insurance opportunity) from AgencyZoom using its unique `driverId`; this action is irreversible. |
| `AGENCYZOOM_DELETE_A_LEAD_FILE` | Delete file from lead | Deletes a specific file (identified by `fileId`) associated with an existing lead (identified by `leadId`); this operation is irreversible. |
| `AGENCYZOOM_DELETE_A_LEAD_OPPORTUNITY` | Delete a lead opportunity | Permanently deletes an existing opportunity (by `opportunityId`) associated with an existing lead (by `leadId`) when it's irrelevant, closed, or erroneous; the lead itself remains. |
| `AGENCYZOOM_DELETE_A_LEAD_QUOTE` | Delete a lead quote | Deletes a specific quote from a lead, requiring that the lead and quote exist and are associated. |
| `AGENCYZOOM_DELETE_AN_OPPORTUNITY` | Delete an opportunity | Permanently deletes a specific opportunity by its unique ID; this action is irreversible and requires a valid, existing `opportunityId`. |
| `AGENCYZOOM_DELETE_A_TASK` | Delete a task | Permanently and irreversibly deletes an existing task, identified by its `taskId`. |
| `AGENCYZOOM_DELETE_A_VEHICLE` | Delete a vehicle | Permanently deletes a vehicle record by its `vehicleId`, which must correspond to an existing vehicle in the AgencyZoom system. |
| `AGENCYZOOM_DELETE_MESSAGE` | Delete thread message | Deletes a specific message from an email thread within AgencyZoom. Requires the message ID to identify which message to remove. Returns the updated thread information with the remaining messages after deletion. |
| `AGENCYZOOM_DELETE_THREAD` | Delete email thread | Permanently deletes a specific email thread from the AgencyZoom system, identified by its `threadId` (expected by the endpoint), provided the thread exists. |
| `AGENCYZOOM_GET_A_LIST_OF_ASSIGN_GROUPS` | Get a list of assign groups | Retrieves all assign groups configured in AgencyZoom, used for categorizing or assigning items to specific teams or units. |
| `AGENCYZOOM_GET_A_LIST_OF_CARRIERS` | Get a list of carriers | Retrieves all insurance carriers from AgencyZoom, typically used for populating selection lists or synchronizing carrier data; does not return detailed policy or coverage information. |
| `AGENCYZOOM_GET_A_LIST_OF_CSRS` | Get a list of CSRs | Fetches all Customer Service Representatives (CSRs), including their ID and name, returning an empty list if none are configured. |
| `AGENCYZOOM_GET_A_LIST_OF_CUSTOM_FIELDS` | Get a list of custom fields | Retrieves metadata for all configured custom field definitions, not the specific values entered for individual records. |
| `AGENCYZOOM_GET_A_LIST_OF_DRIVERS_FOR_AN_OPPORTUNITY` | Get a list of drivers for an opportunity | Retrieves a list of drivers (individuals), including their personal details, licensing information, and relationship status, associated with a specific, existing `opportunityId` in AgencyZoom. |
| `AGENCYZOOM_GET_A_LIST_OF_EMPLOYEES` | Get a list of employees | Retrieves a complete list of all employees for the authenticated agency; returns an empty list if no employees are configured. |
| `AGENCYZOOM_GET_A_LIST_OF_LEAD_SOURCE_CATEGORIES` | Get lead source categories | Retrieves a comprehensive list of all predefined lead source categories from AgencyZoom, used to classify lead origins. |
| `AGENCYZOOM_GET_A_LIST_OF_LEAD_SOURCES` | Get lead sources | Fetches a list of all lead sources configured in AgencyZoom, including their ID, name, sales exclusion status, and category ID. |
| `AGENCYZOOM_GET_A_LIST_OF_LIFE_PROFESSIONALS` | Get a list of life professionals | Retrieves a list of life insurance professionals, including only their contact and status information (excluding sales or customer data), from the AgencyZoom platform. |
| `AGENCYZOOM_GET_A_LIST_OF_LOCATIONS` | Get a list of locations | Retrieves all agency locations or branches from AgencyZoom; filtering options are not available. |
| `AGENCYZOOM_GET_A_LIST_OF_LOSS_REASONS` | Get loss reasons | Retrieves all predefined loss reasons (e.g., 'Lost to competitor', 'Premium too high') available in AgencyZoom. These reasons can be used when marking leads as lost or for reporting purposes. No parameters required - returns complete list. |
| `AGENCYZOOM_GET_A_LIST_OF_PIPELINES` | Get a list of pipelines | Retrieves all pipelines and their stages from AgencyZoom to understand workflow structures; this is a read-only operation and does not return individual items (like leads or tasks) within these pipelines. |
| `AGENCYZOOM_GET_A_LIST_OF_PRODUCER` | Get a list of producers | Retrieves a list of all producers from AgencyZoom, typically related to text thread functionalities. |
| `AGENCYZOOM_GET_A_LIST_OF_PRODUCT_LINES_POLICY_TYPES` | Get product lines and policy types | Fetches all product lines and policy types from AgencyZoom, each detailed with its ID, name, and product category ID. |
| `AGENCYZOOM_GET_A_LIST_OF_RECYCLE_EVENTS` | Get a list of recycle events | Retrieves the available recycle event types and any existing X-Date information for a specified lead in AgencyZoom. Returns a list of recycle event categories that can be used to trigger follow-ups (e.g., 'X-Date', 'Accident Falls Off', 'Prior Insurance Fulfilled'). |
| `AGENCYZOOM_GET_A_LIST_OF_VEHICLES_FOR_AN_OPPORTUNITY` | Retrieve vehicles for opportunity | Retrieves all vehicles associated with an existing opportunity, using its unique opportunityId. |
| `AGENCYZOOM_GET_AMS_POLICIES_FOR_A_CUSTOMER` | Get AMS policies for a customer | Retrieves a customer's synchronized Agency Management System (AMS) policy data (typically a single policy); requires an active AMS integration, may return empty/default values if data is missing. |
| `AGENCYZOOM_GET_AUTH_URL_FOR_V4_SSO` | Get auth URL for V4 SSO | Retrieves a fresh authentication URL for AgencyZoom's V4 Single Sign-On (SSO) process; call before each SSO attempt as the URL may change and should not be cached. |
| `AGENCYZOOM_GET_DEPARTMENTS_GROUPS` | Get departments groups | Fetches department and group information for an agency, optionally filtered by a specific `agencyNumber`, to analyze its organizational structure. |
| `AGENCYZOOM_GET_LEAD_FILES` | Get lead files | Retrieves metadata (id, title, MIME type, size, dates, creator info) for files attached to leads in AgencyZoom. Optionally filter by `leadId` to get files for a specific lead, or omit to retrieve files across all leads. Returns file metadata only, not the actual file content. |
| `AGENCYZOOM_GET_LEAD_NOTES` | Retrieve notes for specific lead | Fetches the complete history of notes for a specific lead by `leadId` (which must exist), useful for reviewing context for communications or follow-ups; this is a read-only operation. |
| `AGENCYZOOM_GET_LEAD_QUOTES` | Get lead quotes | Retrieves all insurance quotes (active and inactive) for a specific lead ID, useful for reviewing or tracking quote history. |
| `AGENCYZOOM_GET_LEAD_TASKS` | Get lead tasks | Retrieves all tasks for a specific lead, identified by its `leadId`, to review its activity history or manage follow-ups. |
| `AGENCYZOOM_GET_LIST_OF_END_STAGES` | Get list of end stages | Fetches a list of all defined end stages, representing final steps in processes like lead conversion or policy closure. |
| `AGENCYZOOM_GET_POLICIES_FOR_A_CUSTOMER` | Get policies for a customer | Retrieves from AgencyZoom all insurance policies for an existing customer (identified by `customerId`), including policy details like type, carrier, premium, effective dates, and assigned agents. Excludes premium payment history or claims information. |
| `AGENCYZOOM_GET_THE_CUSTOMER_DETAILS` | Get the customer details | Fetches comprehensive details for a specific customer, including personal information, policies, notes, tasks, files, and custom fields, using their unique customer ID. |
| `AGENCYZOOM_GET_THE_CUSTOMER_TASKS` | Get the customer tasks | Fetches all tasks (read-only task data) for a customer by `customerId` to review their activities, follow-ups, and action items; the `customerId` must be valid. |
| `AGENCYZOOM_GET_THE_DRIVER_DETAILS` | Get the driver details | Retrieves detailed information for a specific, existing driver (by `driverId`) associated with an AgencyZoom opportunity. |
| `AGENCYZOOM_GET_THE_LEAD_DETAILS` | Get the lead details | Retrieves comprehensive details for a specific lead in AgencyZoom by its unique `leadId` (which must correspond to an existing lead), including contact information, status, associated opportunities, quotes/policies, custom fields, and interaction history. |
| `AGENCYZOOM_GET_THE_OPPORTUNITIES_FOR_A_LEAD` | Get the opportunities for a lead | Retrieves all sales opportunities and their details for a specified, existing `leadId` in AgencyZoom. |
| `AGENCYZOOM_GET_THE_OPPORTUNITY_DETAILS` | Get the opportunity details | Fetches comprehensive details for an existing opportunity using its unique `opportunityId`. |
| `AGENCYZOOM_GET_THE_TASK_DETAILS` | Get the task details | Retrieves comprehensive details for a specific task using its unique `taskId`, which must correspond to an existing task in AgencyZoom. |
| `AGENCYZOOM_GET_THE_VEHICLE_DETAILS` | Get the vehicle details | Retrieves detailed information for a specific vehicle, often associated with an AgencyZoom opportunity, using its unique vehicleId. |
| `AGENCYZOOM_GET_THREAD_DETAILS` | Get thread details | Searches and retrieves detailed information for email threads in AgencyZoom; no explicit search criteria are passed in this request. |
| `AGENCYZOOM_LINK_A_DRIVER_TO_OPPORTUNITY` | Link a driver to opportunity | Assigns or reassigns an existing driver to an existing opportunity. |
| `AGENCYZOOM_LINK_A_VEHICLE_TO_OPPORTUNITY` | Link vehicle to opportunity | Links an existing vehicle to an existing sales opportunity in AgencyZoom using their respective IDs, typically for managing auto insurance policies or related services. |
| `AGENCYZOOM_LIST_PRODUCT_CATEGORIES` | List Product Categories | Retrieves a complete, unfiltered list of all product categories (ID and name) from AgencyZoom, useful for understanding product organization or populating UI elements. |
| `AGENCYZOOM_LOG_THE_USER_IN` | Log the user in | Authenticates an existing AgencyZoom user using their email (as username) and password to obtain a JWT for API access; this action does not support new user creation. |
| `AGENCYZOOM_LOG_THE_USER_OUT` | Log the user out | Use this action to log the current user out of AgencyZoom by invalidating their active session token. |
| `AGENCYZOOM_MARK_THREAD_AS_UNREAD_API_ENDPOINT` | Mark thread as unread | Marks a text thread in AgencyZoom as read or unread using its `threadId`; this action does not modify message content and the specified `threadId` must refer to an existing thread. |
| `AGENCYZOOM_MOVE_LEAD_TO_SOLD` | Move lead to sold | Marks an existing lead as sold by its `leadId` and records product details; `productLineId`, `premium`, `effectiveDate`, and `soldDate` are operationally required for each sold product, despite schema flexibility. |
| `AGENCYZOOM_REMOVE_TEXT_THREAD_ENDPOINT` | Remove text thread | Call this action to permanently delete an SMS/text message thread in AgencyZoom; the target thread is identified by its `threadId`. Note: This operation is idempotent - deleting a non-existent thread will return success. |
| `AGENCYZOOM_REOPEN_A_TASK` | Reopen a task | Reopens an existing AgencyZoom task that is currently 'completed' or 'closed', allowing it to be reactivated with optional comments. |
| `AGENCYZOOM_SEARCH_BUSINESS_CLASSIFICATIONS` | Search business classifications | Retrieves a comprehensive list of all available business classifications from AgencyZoom, each including an ID, code, and description. |
| `AGENCYZOOM_SEARCH_CUSTOMERS` | Search customers | Searches for customers in AgencyZoom using criteria like contact information, policy details, or custom fields, with options for filtering, sorting, and pagination. |
| `AGENCYZOOM_SEARCH_EMAIL_THREADS` | Search email threads | Retrieves a list of email thread metadata from AgencyZoom, suitable for an overview when no specific filtering, sorting, or pagination is needed, as results are subject to default server-side limits and ordering. |
| `AGENCYZOOM_SEARCH_LEADS` | Search leads | Retrieves AgencyZoom leads, using filters, pagination, and sorting options sent in the POST body, as the request schema itself is empty. |
| `AGENCYZOOM_SEARCH_LEADS_COUNT` | Search leads count | Retrieves a summary of lead counts categorized by workflow stage from AgencyZoom; this action does not support filtering and returns aggregate counts rather than individual lead details. |
| `AGENCYZOOM_SEARCH_LIFE_AND_HEALTH_LEADS` | Search life and health leads | Searches for life and health insurance leads by providing filter criteria (matching AlrLead fields) in the request body; an empty request may retrieve all leads or a default set. |
| `AGENCYZOOM_SEARCH_SMS_THREADS` | Search SMS threads | Searches and retrieves SMS threads from AgencyZoom, with search parameters, filters, sorting, and pagination typically provided in the request body of this POST operation. |
| `AGENCYZOOM_SEARCH_TASKS` | Search and list tasks | Searches and lists tasks, supporting pagination and accepting filter criteria in the POST request body despite an empty request schema. |
| `AGENCYZOOM_SERVICE_TICKET_LIST` | List service tickets | Retrieves a paginated list of service tickets from AgencyZoom. Supports filtering by: - Status (0=removed, 1=active, 2=completed) - Priority ID and Category ID Returns service ticket details including subject, description, dates, assignment information, and workflow stage. Results are paginated with default page size of 20 tickets per page. |
| `AGENCYZOOM_TEXT_DETAIL_THREAD` | Get SMS thread messages | Retrieves detailed messages for a specific SMS/text thread by its thread ID. Returns all messages in the thread with their content, attachments, sender/recipient information, and metadata. The thread ID can be obtained from the search_sms_threads action. |
| `AGENCYZOOM_UNLINK_A_DRIVER_FROM_OPPORTUNITY` | Unlink driver from opportunity | Unlinks a currently associated driver from an AgencyZoom opportunity, used when the driver is no longer relevant, for policy or data updates, potentially impacting the opportunity's status or associated policy details. |
| `AGENCYZOOM_UNLINK_A_VEHICLE_FROM_OPPORTUNITY` | Unlink vehicle from opportunity | Unlinks a specific, existing vehicle from a specific, existing opportunity using their respective IDs, removing only the association and not the records themselves. |
| `AGENCYZOOM_UNREAD_THREAD` | Update email thread read status | Updates the read or unread status of a specific email thread within AgencyZoom. |
| `AGENCYZOOM_UPDATE_A_DRIVER_S_DETAILS` | Update a driver's details | Updates an existing driver's details in AgencyZoom, requiring `driverId` in the path and `firstName` and `lastName` in the request. |
| `AGENCYZOOM_UPDATE_A_LEAD_FILE_NAME` | Rename lead file | Updates a lead's file name to `newFileName`; requires `fileId` of the target file, which must be associated with both the `leadId` (path parameter) and the provided `customerReferralId`. |
| `AGENCYZOOM_UPDATE_A_LEAD_OPPORTUNITY` | Update a lead opportunity | Updates an existing opportunity's details (carrier, product line, premium, items, custom fields) for a specific lead; `leadId`, opportunity `id`, `carrierId`, and `productLineId` must refer to existing entities. |
| `AGENCYZOOM_UPDATE_A_LEAD_QUOTE` | Update lead quote data | Updates an existing quote for a specified lead in AgencyZoom when its details require revision, ensuring the provided `leadId` (path parameter), quote `id` (body parameter), `carrierId`, and `productLineId` are valid and correspond to existing entities. |
| `AGENCYZOOM_UPDATE_AN_OPPORTUNITY` | Update an opportunity | Updates an existing opportunity with the provided details; ensure any custom field names are predefined in AgencyZoom configuration. |
| `AGENCYZOOM_UPDATE_A_POLICY` | Update policy by id | Updates an existing insurance policy for the given `policyId`; monetary values must be in cents and dates in YYYY-MM-DD format. |
| `AGENCYZOOM_UPDATE_A_VEHICLE_S_DETAILS` | Update a vehicle's details | Updates details for an existing vehicle within an opportunity; this action cannot be used to create new vehicle records. |
| `AGENCYZOOM_UPDATE_BUSINESS_LEAD` | Update business lead | Updates an existing business lead in AgencyZoom. Requires leadId (path parameter) plus core business information fields: firstname, email, name (business name), pipelineId, stageId, leadSourceId, assignTo (producer ID), and country. All other fields are optional and will only update if provided. |
| `AGENCYZOOM_UPDATE_CUSTOMER` | Update customer info using id | Updates an existing customer's information in AgencyZoom using their unique customerId. |
| `AGENCYZOOM_UPDATE_LEAD` | Update lead | Updates an existing lead's information in AgencyZoom using the `leadId`; ensure the `leadId` corresponds to an existing lead in AgencyZoom. |
| `AGENCYZOOM_UPDATE_LEAD_STATUS_BY_ID` | Update lead status by id | Updates a lead's status (0=ACTIVE, 2=WON, 3=LOST, 5=XDATED) by `leadId`, optionally setting workflow, stage, date, loss reason, X-date type, source, recycle stage/pipeline, or tags; requires `date` and `xDateType` for status 5 (XDATED), and `lossReasonId` for status 3 (LOST). |
| `AGENCYZOOM_UPDATE_MY_PROFILE` | Update my profile | Updates the profile information (first name, last name, email, and optional phone) for the currently authenticated user in AgencyZoom; the provided email address must be unique within the system. |
| `AGENCYZOOM_UPDATE_TAGS_FOR_A_POLICY` | Add tags to a policy | Adds new comma-separated `tagNames` to a policy, requiring `tagNames` and identification by either `policyId` or `amsPolicyId`; if `amsPolicyId` is provided, `policyId` is ignored, and existing tags are not affected. |
| `AGENCYZOOM_UPDATE_TASK` | Update task | Modifies an existing AgencyZoom task (which must be valid and identified by `taskId` in the path) with new attributes from the request body, which must also contain `taskId`. |
| `AGENCYZOOM_V4_SSO_LOG_THE_USER_IN` | Log user in via SSO | Logs a user into the AgencyZoom platform via Single Sign-On (SSO). Returns JWT on success or error details on authentication failure. |

## Supported Triggers

None listed.

## Creating MCP Server - Stand-alone vs Composio SDK

The Agencyzoom MCP server is an implementation of the Model Context Protocol that connects your AI agent to Agencyzoom. It provides structured and secure access so your agent can perform Agencyzoom operations on your behalf through a secure, permission-based interface.
With Composio's managed implementation, you don't have to create your own developer app. For production, if you're building an end product, we recommend using your own credentials. The managed server helps you prototype fast and go from 0-1 faster.

## Step-by-step Guide

### 1. Prerequisites

No description provided.

### 1. Getting API Keys for OpenAI and Composio

OpenAI API Key
- Go to the [OpenAI dashboard](https://platform.openai.com/settings/organization/api-keys) and create an API key. You'll need credits to use the models, or you can connect to another model provider.
- Keep the API key safe.
Composio API Key
- Log in to the [Composio dashboard](https://dashboard.composio.dev?utm_source=toolkits&utm_medium=framework_docs).
- Navigate to your API settings and generate a new API key.
- Store this key securely as you'll need it for authentication.

### 2. Install dependencies

No description provided.
```python
pip install composio-langchain langchain-mcp-adapters langchain python-dotenv
```

```typescript
npm install @composio/langchain @langchain/core @langchain/openai @langchain/mcp-adapters dotenv
```

### 3. Set up environment variables

Create a .env file in your project root.
What's happening:
- COMPOSIO_API_KEY authenticates your requests to Composio's API
- COMPOSIO_USER_ID identifies the user for session management
- OPENAI_API_KEY enables access to OpenAI's language models
```bash
COMPOSIO_API_KEY=your_composio_api_key_here
COMPOSIO_USER_ID=your_composio_user_id_here
OPENAI_API_KEY=your_openai_api_key_here
```

### 4. Import dependencies

No description provided.
```python
from langchain_mcp_adapters.client import MultiServerMCPClient
from langchain.agents import create_agent
from dotenv import load_dotenv
from composio import Composio
import asyncio
import os

load_dotenv()
```

```typescript
import { Composio } from '@composio/core';
import { LangchainProvider } from '@composio/langchain';
import { MultiServerMCPClient } from "@langchain/mcp-adapters";
import { createAgent } from "langchain";
import * as readline from 'readline';
import 'dotenv/config';

dotenv.config();
```

### 5. Initialize Composio client

What's happening:
- We're loading the COMPOSIO_API_KEY from environment variables and validating it exists
- Creating a Composio instance that will manage our connection to Agencyzoom tools
- Validating that COMPOSIO_USER_ID is also set before proceeding
```python
async def main():
    composio = Composio(api_key=os.getenv("COMPOSIO_API_KEY"))

    if not os.getenv("COMPOSIO_API_KEY"):
        raise ValueError("COMPOSIO_API_KEY is not set")
    if not os.getenv("COMPOSIO_USER_ID"):
        raise ValueError("COMPOSIO_USER_ID is not set")
```

```typescript
const composioApiKey = process.env.COMPOSIO_API_KEY;
const userId = process.env.COMPOSIO_USER_ID;

if (!composioApiKey) throw new Error('COMPOSIO_API_KEY is not set');
if (!userId) throw new Error('COMPOSIO_USER_ID is not set');

async function main() {
    const composio = new Composio({
        apiKey: composioApiKey as string,
        provider: new LangchainProvider()
    });
```

### 6. Create a Tool Router session

What's happening:
- We're creating a Tool Router session that gives your agent access to Agencyzoom tools
- The create method takes the user ID and specifies which toolkits should be available
- The returned session.mcp.url is the MCP server URL that your agent will use
- This approach allows the agent to dynamically load and use Agencyzoom tools as needed
```python
# Create Tool Router session for Agencyzoom
session = composio.create(
    user_id=os.getenv("COMPOSIO_USER_ID"),
    toolkits=['agencyzoom']
)

url = session.mcp.url
```

```typescript
const session = await composio.create(
    userId as string,
    {
        toolkits: ['agencyzoom']
    }
);

const url = session.mcp.url;
```

### 7. Configure the agent with the MCP URL

No description provided.
```python
client = MultiServerMCPClient({
    "agencyzoom-agent": {
        "transport": "streamable_http",
        "url": session.mcp.url,
        "headers": {
            "x-api-key": os.getenv("COMPOSIO_API_KEY")
        }
    }
})

tools = await client.get_tools()

agent = create_agent("gpt-5", tools)
```

```typescript
const client = new MultiServerMCPClient({
    "agencyzoom-agent": {
        transport: "http",
        url: url,
        headers: {
            "x-api-key": process.env.COMPOSIO_API_KEY
        }
    }
});

const tools = await client.getTools();

const agent = createAgent({ model: "gpt-5", tools });
```

### 8. Set up interactive chat interface

No description provided.
```python
conversation_history = []

print("Chat started! Type 'exit' or 'quit' to end the conversation.\n")
print("Ask any Agencyzoom related question or task to the agent.\n")

while True:
    user_input = input("You: ").strip()

    if user_input.lower() in ['exit', 'quit', 'bye']:
        print("\nGoodbye!")
        break

    if not user_input:
        continue

    conversation_history.append({"role": "user", "content": user_input})
    print("\nAgent is thinking...\n")

    response = await agent.ainvoke({"messages": conversation_history})
    conversation_history = response['messages']
    final_response = response['messages'][-1].content
    print(f"Agent: {final_response}\n")
```

```typescript
let conversationHistory: any[] = [];

console.log("Chat started! Type 'exit' or 'quit' to end the conversation.\n");
console.log("Ask any Agencyzoom related question or task to the agent.\n");

const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout,
    prompt: 'You: '
});

rl.prompt();

rl.on('line', async (userInput: string) => {
    const trimmedInput = userInput.trim();

    if (['exit', 'quit', 'bye'].includes(trimmedInput.toLowerCase())) {
        console.log("\nGoodbye!");
        rl.close();
        process.exit(0);
    }

    if (!trimmedInput) {
        rl.prompt();
        return;
    }

    conversationHistory.push({ role: "user", content: trimmedInput });
    console.log("\nAgent is thinking...\n");

    const response = await agent.invoke({ messages: conversationHistory });
    conversationHistory = response.messages;

    const finalResponse = response.messages[response.messages.length - 1]?.content;
    console.log(`Agent: ${finalResponse}\n`);
        
        rl.prompt();
    });

    rl.on('close', () => {
        console.log('\n👋 Session ended.');
        process.exit(0);
    });
```

### 9. Run the application

No description provided.
```python
if __name__ == "__main__":
    asyncio.run(main())
```

```typescript
main().catch((err) => {
    console.error('Fatal error:', err);
    process.exit(1);
});
```

## Complete Code

```python
from langchain_mcp_adapters.client import MultiServerMCPClient
from langchain.agents import create_agent
from dotenv import load_dotenv
from composio import Composio
import asyncio
import os

load_dotenv()

async def main():
    composio = Composio(api_key=os.getenv("COMPOSIO_API_KEY"))
    
    if not os.getenv("COMPOSIO_API_KEY"):
        raise ValueError("COMPOSIO_API_KEY is not set")
    if not os.getenv("COMPOSIO_USER_ID"):
        raise ValueError("COMPOSIO_USER_ID is not set")
    
    session = composio.create(
        user_id=os.getenv("COMPOSIO_USER_ID"),
        toolkits=['agencyzoom']
    )

    url = session.mcp.url
    
    client = MultiServerMCPClient({
        "agencyzoom-agent": {
            "transport": "streamable_http",
            "url": url,
            "headers": {
                "x-api-key": os.getenv("COMPOSIO_API_KEY")
            }
        }
    })
    
    tools = await client.get_tools()
  
    agent = create_agent("gpt-5", tools)
    
    conversation_history = []
    
    print("Chat started! Type 'exit' or 'quit' to end the conversation.\n")
    print("Ask any Agencyzoom related question or task to the agent.\n")
    
    while True:
        user_input = input("You: ").strip()
        
        if user_input.lower() in ['exit', 'quit', 'bye']:
            print("\nGoodbye!")
            break
        
        if not user_input:
            continue
        
        conversation_history.append({"role": "user", "content": user_input})
        print("\nAgent is thinking...\n")
        
        response = await agent.ainvoke({"messages": conversation_history})
        conversation_history = response['messages']
        final_response = response['messages'][-1].content
        print(f"Agent: {final_response}\n")

if __name__ == "__main__":
    asyncio.run(main())
```

```typescript
import { Composio } from '@composio/core';
import { LangchainProvider } from '@composio/langchain';
import { MultiServerMCPClient } from "@langchain/mcp-adapters";  
import { createAgent } from "langchain";
import * as readline from 'readline';
import 'dotenv/config';

const composioApiKey = process.env.COMPOSIO_API_KEY;
const userId = process.env.COMPOSIO_USER_ID;

if (!composioApiKey) throw new Error('COMPOSIO_API_KEY is not set');
if (!userId) throw new Error('COMPOSIO_USER_ID is not set');

async function main() {
    const composio = new Composio({
        apiKey: composioApiKey as string,
        provider: new LangchainProvider()
    });

    const session = await composio.create(
        userId as string,
        {
            toolkits: ['agencyzoom']
        }
    );

    const url = session.mcp.url;
    
    const client = new MultiServerMCPClient({
        "agencyzoom-agent": {
            transport: "http",
            url: url,
            headers: {
                "x-api-key": process.env.COMPOSIO_API_KEY
            }
        }
    });
    
    const tools = await client.getTools();
  
    const agent = createAgent({ model: "gpt-5", tools });
    
    let conversationHistory: any[] = [];
    
    console.log("Chat started! Type 'exit' or 'quit' to end the conversation.\n");
    console.log("Ask any Agencyzoom related question or task to the agent.\n");
    
    const rl = readline.createInterface({
        input: process.stdin,
        output: process.stdout,
        prompt: 'You: '
    });

    rl.prompt();

    rl.on('line', async (userInput: string) => {
        const trimmedInput = userInput.trim();
        
        if (['exit', 'quit', 'bye'].includes(trimmedInput.toLowerCase())) {
            console.log("\nGoodbye!");
            rl.close();
            process.exit(0);
        }
        
        if (!trimmedInput) {
            rl.prompt();
            return;
        }
        
        conversationHistory.push({ role: "user", content: trimmedInput });
        console.log("\nAgent is thinking...\n");
        
        const response = await agent.invoke({ messages: conversationHistory });
        conversationHistory = response.messages;
        
        const finalResponse = response.messages[response.messages.length - 1]?.content;
        console.log(`Agent: ${finalResponse}\n`);
        
        rl.prompt();
    });

    rl.on('close', () => {
        console.log('\nSession ended.');
        process.exit(0);
    });
}

main().catch((err) => {
    console.error('Fatal error:', err);
    process.exit(1);
});
```

## Conclusion

You've successfully built a LangChain agent that can interact with Agencyzoom through Composio's Tool Router.
Key features of this implementation:
- Dynamic tool loading through Composio's Tool Router
- Conversation history maintenance for context-aware responses
- Async Python provides clean, efficient execution of agent workflows
You can extend this further by adding error handling, implementing specific business logic, or integrating additional Composio toolkits to create multi-app workflows.

## How to build Agencyzoom MCP Agent with another framework

- [OpenAI Agents SDK](https://composio.dev/toolkits/agencyzoom/framework/open-ai-agents-sdk)
- [Claude Agent SDK](https://composio.dev/toolkits/agencyzoom/framework/claude-agents-sdk)
- [Claude Code](https://composio.dev/toolkits/agencyzoom/framework/claude-code)
- [Claude Cowork](https://composio.dev/toolkits/agencyzoom/framework/claude-cowork)
- [Codex](https://composio.dev/toolkits/agencyzoom/framework/codex)
- [OpenClaw](https://composio.dev/toolkits/agencyzoom/framework/openclaw)
- [Hermes](https://composio.dev/toolkits/agencyzoom/framework/hermes-agent)
- [CLI](https://composio.dev/toolkits/agencyzoom/framework/cli)
- [Google ADK](https://composio.dev/toolkits/agencyzoom/framework/google-adk)
- [Vercel AI SDK](https://composio.dev/toolkits/agencyzoom/framework/ai-sdk)
- [Mastra AI](https://composio.dev/toolkits/agencyzoom/framework/mastra-ai)
- [LlamaIndex](https://composio.dev/toolkits/agencyzoom/framework/llama-index)
- [CrewAI](https://composio.dev/toolkits/agencyzoom/framework/crew-ai)

## Related Toolkits

- [Hubspot](https://composio.dev/toolkits/hubspot) - HubSpot is an all-in-one marketing, sales, and customer service platform. It lets teams nurture leads, automate outreach, and track every customer interaction in one place.
- [Pipedrive](https://composio.dev/toolkits/pipedrive) - Pipedrive is a sales management platform offering pipeline visualization, lead tracking, and workflow automation. It helps sales teams keep deals moving forward efficiently and never miss a follow-up.
- [Salesforce](https://composio.dev/toolkits/salesforce) - Salesforce is a leading CRM platform that helps businesses manage sales, service, and marketing. It centralizes customer data, enabling teams to drive growth and build strong relationships.
- [Apollo](https://composio.dev/toolkits/apollo) - Apollo is a CRM and lead generation platform that helps businesses discover contacts and manage sales pipelines. Use it to streamline customer outreach and track your deals from one place.
- [Attio](https://composio.dev/toolkits/attio) - Attio is a customizable CRM and workspace for managing your team's relationships and workflows. It helps teams organize contacts, automate tasks, and collaborate more efficiently.
- [Acculynx](https://composio.dev/toolkits/acculynx) - AccuLynx is a cloud-based roofing business management software for contractors. It streamlines project tracking, lead management, and document sharing.
- [Addressfinder](https://composio.dev/toolkits/addressfinder) - Addressfinder is a data quality platform for verifying addresses, emails, and phone numbers. It helps you ensure accurate customer and contact data every time.
- [Affinity](https://composio.dev/toolkits/affinity) - Affinity is a relationship intelligence CRM that helps private capital investors find, manage, and close more deals. It streamlines deal flow and surfaces key connections to help you win opportunities.
- [Bettercontact](https://composio.dev/toolkits/bettercontact) - Bettercontact is a smart contact enrichment tool for finding emails and phone numbers. It helps boost lead generation with automated, waterfall search across multiple sources.
- [Blackbaud](https://composio.dev/toolkits/blackbaud) - Blackbaud provides cloud-based software for nonprofits, schools, and healthcare institutions. It streamlines fundraising, donor management, and mission-driven operations.
- [Brilliant directories](https://composio.dev/toolkits/brilliant_directories) - Brilliant Directories is an all-in-one platform for building and managing online membership communities and business directories. It streamlines listings, member management, and engagement tools into a single, easy interface.
- [Capsule crm](https://composio.dev/toolkits/capsule_crm) - Capsule CRM is a user-friendly CRM platform for managing contacts and sales pipelines. It helps businesses organize relationships and streamline their sales process efficiently.
- [Centralstationcrm](https://composio.dev/toolkits/centralstationcrm) - CentralStationCRM is an easy-to-use CRM software focused on collaboration and long-term customer relationships. It helps teams manage contacts, deals, and communications all in one place.
- [Clientary](https://composio.dev/toolkits/clientary) - Clientary is a platform for managing clients, invoices, projects, proposals, and more. It streamlines client work and saves you serious admin time.
- [Close](https://composio.dev/toolkits/close) - Close is a CRM platform built for sales teams, combining calling, email automation, and predictive dialers. It streamlines sales workflows and boosts productivity with all-in-one communication tools.
- [Dropcontact](https://composio.dev/toolkits/dropcontact) - Dropcontact is a B2B email finder and data enrichment service for professionals. It delivers verified email addresses and enriches contact info with up-to-date data.
- [Dynamics365](https://composio.dev/toolkits/dynamics365) - Dynamics 365 is Microsoft's platform combining CRM, ERP, and productivity apps. It streamlines sales, marketing, service, and operations in one place.
- [Espocrm](https://composio.dev/toolkits/espocrm) - EspoCRM is an open-source web application for managing customer relationships. It helps businesses organize contacts, track leads, and streamline their sales process.
- [Fireberry](https://composio.dev/toolkits/fireberry) - Fireberry is a CRM platform that streamlines customer and sales management. It helps businesses organize contacts, automate sales, and integrate with other business tools.
- [Firmao](https://composio.dev/toolkits/firmao) - Firmao is a business information platform offering company, industry, and market data. Use it to quickly research firms and gain competitive market insights.

## Frequently Asked Questions

### What are the differences in Tool Router MCP and Agencyzoom MCP?

With a standalone Agencyzoom MCP server, the agents and LLMs can only access a fixed set of Agencyzoom tools tied to that server. However, with the Composio Tool Router, agents can dynamically load tools from Agencyzoom and many other apps based on the task at hand, all through a single MCP endpoint.

### Can I use Tool Router MCP with LangChain?

Yes, you can. LangChain fully supports MCP integration. You get structured tool calling, message history handling, and model orchestration while Tool Router takes care of discovering and serving the right Agencyzoom tools.

### Can I manage the permissions and scopes for Agencyzoom while using Tool Router?

Yes, absolutely. You can configure which Agencyzoom scopes and actions are allowed when connecting your account to Composio. You can also bring your own OAuth credentials or API configuration so you keep full control over what the agent can do.

### How safe is my data with Composio Tool Router?

All sensitive data such as tokens, keys, and configuration is fully encrypted at rest and in transit. Composio is SOC 2 Type 2 compliant and follows strict security practices so your Agencyzoom data and credentials are handled as safely as possible.

---
[See all toolkits](https://composio.dev/toolkits) · [Composio docs](https://docs.composio.dev/llms.txt)
