# How to integrate Salesforce MCP with OpenAI Agents SDK

```json
{
  "title": "How to integrate Salesforce MCP with OpenAI Agents SDK",
  "toolkit": "Salesforce",
  "toolkit_slug": "salesforce",
  "framework": "OpenAI Agents SDK",
  "framework_slug": "open-ai-agents-sdk",
  "url": "https://composio.dev/toolkits/salesforce/framework/open-ai-agents-sdk",
  "markdown_url": "https://composio.dev/toolkits/salesforce/framework/open-ai-agents-sdk.md",
  "updated_at": "2026-05-12T10:24:33.804Z"
}
```

## Introduction

This guide walks you through connecting Salesforce to the OpenAI Agents SDK using the Composio tool router. By the end, you'll have a working Salesforce agent that can add new contact to spring campaign, clone opportunity with all associated products, complete follow-up task for lead smith through natural language commands.
This guide will help you understand how to give your OpenAI Agents SDK agent real control over a Salesforce account through Composio's Salesforce MCP server.
Before we dive in, let's take a quick look at the key ideas and tools involved.

## Also integrate Salesforce with

- [ChatGPT](https://composio.dev/toolkits/salesforce/framework/chatgpt)
- [Claude Agent SDK](https://composio.dev/toolkits/salesforce/framework/claude-agents-sdk)
- [Claude Code](https://composio.dev/toolkits/salesforce/framework/claude-code)
- [Claude Cowork](https://composio.dev/toolkits/salesforce/framework/claude-cowork)
- [Codex](https://composio.dev/toolkits/salesforce/framework/codex)
- [Cursor](https://composio.dev/toolkits/salesforce/framework/cursor)
- [VS Code](https://composio.dev/toolkits/salesforce/framework/vscode)
- [OpenCode](https://composio.dev/toolkits/salesforce/framework/opencode)
- [OpenClaw](https://composio.dev/toolkits/salesforce/framework/openclaw)
- [Hermes](https://composio.dev/toolkits/salesforce/framework/hermes-agent)
- [CLI](https://composio.dev/toolkits/salesforce/framework/cli)
- [Google ADK](https://composio.dev/toolkits/salesforce/framework/google-adk)
- [LangChain](https://composio.dev/toolkits/salesforce/framework/langchain)
- [Vercel AI SDK](https://composio.dev/toolkits/salesforce/framework/ai-sdk)
- [Mastra AI](https://composio.dev/toolkits/salesforce/framework/mastra-ai)
- [LlamaIndex](https://composio.dev/toolkits/salesforce/framework/llama-index)
- [CrewAI](https://composio.dev/toolkits/salesforce/framework/crew-ai)

## TL;DR

Here's what you'll learn:
- Get and set up your OpenAI and Composio API keys
- Install the necessary dependencies
- Initialize Composio and create a Tool Router session for Salesforce
- Configure an AI agent that can use Salesforce as a tool
- Run a live chat session where you can ask the agent to perform Salesforce operations

## What is OpenAI Agents SDK?

The OpenAI Agents SDK is a lightweight framework for building AI agents that can use tools and maintain conversation state. It provides a simple interface for creating agents with hosted MCP tool support.
Key features include:
- Hosted MCP Tools: Connect to external services through hosted MCP endpoints
- SQLite Sessions: Persist conversation history across interactions
- Simple API: Clean interface with Agent, Runner, and tool configuration
- Streaming Support: Real-time response streaming for interactive applications

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

The Salesforce MCP server is an implementation of the Model Context Protocol that connects your AI agent and assistants like Claude, Cursor, etc directly to your Salesforce account. It provides structured and secure access to your CRM data, so your agent can perform actions like managing contacts, handling opportunities, automating campaigns, and tracking tasks on your behalf.
- Automated contact and lead management: Effortlessly create new accounts, add contacts or leads to campaigns, and associate contacts with accounts to keep your CRM data up-to-date.
- Streamlined opportunity management: Let your agent clone opportunities, add products to deals, and manage the full sales cycle for your pipeline.
- Intelligent campaign automation: Enable your agent to create campaigns, enroll contacts or leads, and track campaign engagement for more effective marketing.
- Task completion and workflow efficiency: Have your agent mark Salesforce tasks as completed and update records, keeping your team on track without manual intervention.
- Flexible record operations: Allow the agent to clone existing records or apply lead assignment rules, ensuring data consistency and smart routing across your Salesforce environment.

## Supported Tools

| Tool slug | Name | Description |
|---|---|---|
| `SALESFORCE_ADD_CONTACT_TO_CAMPAIGN` | Add contact to campaign | Adds a contact to a campaign by creating a CampaignMember record to track campaign engagement. Fails if the contact is already a member of the campaign; pre-check membership via SOQL before calling. |
| `SALESFORCE_ADD_LEAD_TO_CAMPAIGN` | Add lead to campaign | Adds a lead to a campaign by creating a CampaignMember record, allowing you to track campaign engagement. Both `campaign_id` and `lead_id` must be valid Salesforce IDs of active, existing records — names or emails cannot be substituted, and deleted or inactive records will cause the call to fail. This is a persistent CRM write; confirm the correct lead and campaign before calling. |
| `SALESFORCE_ADD_OPPORTUNITY_LINE_ITEM` | Add product to opportunity | Adds a product (line item) to an opportunity. The product must exist in a pricebook entry that's associated with the opportunity's pricebook. |
| `SALESFORCE_APPLY_LEAD_ASSIGNMENT_RULES` | Apply lead assignment rules | Applies configured lead assignment rules to a specific lead, automatically routing it to the appropriate owner based on your organization's rules. Allow a brief propagation delay before querying updated ownership or field values after rule application. |
| `SALESFORCE_ASSOCIATE_CONTACT_TO_ACCOUNT` | Associate contact to account | Associates a contact with an account by updating the contact's AccountId field. Overwrites any existing AccountId on the contact. For broader contact field updates alongside the account association, use SALESFORCE_UPDATE_CONTACT instead. |
| `SALESFORCE_CLONE_OPPORTUNITY_WITH_PRODUCTS` | Clone opportunity with products | Clones an opportunity and optionally its products (line items). Creates a new opportunity with the same field values and products as the original. |
| `SALESFORCE_CLONE_RECORD` | Clone record | Creates a copy of an existing Salesforce record by reading its data, removing system fields, and creating a new record. Optionally apply field updates to the clone. |
| `SALESFORCE_CLOSE_OR_ABORT_JOB` | Close or abort a job | Tool to close or abort a Salesforce Bulk API v2 ingest job. Use when you need to finalize job processing by closing (state: UploadComplete) or cancel a job by aborting (state: Aborted). This is required for every ingest job - closing queues data for processing, while aborting cancels the job and deletes uploaded data. |
| `SALESFORCE_COMPLETE_TASK` | Complete task | Marks a task as completed with optional completion notes. This is a convenience action that updates the task status to 'Completed'. |
| `SALESFORCE_CREATE_ACCOUNT` | Create account | Creates a new account in Salesforce with the specified information. Returns the created Account's ID at `data.response_data.id`. |
| `SALESFORCE_CREATE_A_RECORD` | Create a record | Tool to create a Salesforce record using the UI API. Use when you need to create any type of Salesforce record with layout metadata and formatted field values. |
| `SALESFORCE_CREATE_CAMPAIGN` | Create campaign | Creates a new campaign in Salesforce. Only `name` is universally required, but org-level validation rules commonly enforce `type`, `status`, `start_date`, and `end_date` as well — omitting them may cause creation to fail. |
| `SALESFORCE_CREATE_CONTACT` | Create contact | Creates a new contact in Salesforce with the specified information. Writes to live CRM data — obtain explicit user confirmation before executing. Failures may reflect org-specific validation rules, permission restrictions, or duplicate rules rather than invalid inputs. |
| `SALESFORCE_CREATE_CUSTOM_FIELD` | Create custom field | Tool to create a custom field on a Salesforce object using the Tooling API. Use when you need to add a new field (Text, Number, Checkbox, Date, Picklist, Lookup, etc.) to any standard or custom object without deploying metadata packages. The Tooling API provides direct field creation for rapid development and automation tasks. |
| `SALESFORCE_CREATE_CUSTOM_OBJECT` | Create custom object | Tool to create a custom object in Salesforce using the Metadata API. Use when you need to dynamically create new object types (tables) in Salesforce with custom fields and configurations. |
| `SALESFORCE_CREATE_LEAD` | Create lead | Creates a new lead in Salesforce. `LastName` and `Company` are required. Org-level validation rules (e.g., email format, custom required fields) may reject requests beyond these; inspect the error response body for the failing field. The created lead `id` is returned in a response wrapper, not at the top level. |
| `SALESFORCE_CREATE_NOTE` | Create note | Creates a new note attached to a Salesforce record with the specified title and content. Does not deduplicate — identical calls create duplicate notes. High-volume creation can trigger REQUEST_LIMIT_EXCEEDED; apply exponential backoff on retries. |
| `SALESFORCE_CREATE_OPPORTUNITY` | Create opportunity | Creates a new opportunity in Salesforce with the specified information. |
| `SALESFORCE_CREATE_S_OBJECT_RECORD` | Create SObject record | Tool to create a new Salesforce SObject record. Use when you need to create any type of standard or custom Salesforce object record by specifying the object type and field values. |
| `SALESFORCE_CREATE_SOBJECT_TREE` | Create sObject tree | Tool to create one or more sObject trees with root records of the specified type. Use when creating nested parent-child record hierarchies in a single atomic operation (e.g., Account with Contacts and Opportunities). Supports up to 200 total records across all trees, up to 5 levels deep, with maximum 5 different object types. All records succeed or all fail together. |
| `SALESFORCE_CREATE_TASK` | Create task | Creates a new task in Salesforce to track activities, to-dos, and follow-ups related to contacts, leads, or other records. Ensure who_id, what_id, and owner_id reference existing records before calling; invalid IDs cause silent linkage failures or validation errors. |
| `SALESFORCE_DELETE_ACCOUNT` | Delete account | Permanently deletes an account from Salesforce. This action cannot be undone. |
| `SALESFORCE_DELETE_CAMPAIGN` | Delete campaign | Permanently deletes a campaign from Salesforce. This action cannot be undone. |
| `SALESFORCE_DELETE_CONTACT` | Delete contact | Permanently deletes a contact from Salesforce. This action cannot be undone. Associated records (activities, opportunities) lose the contact reference upon deletion — ensure related data is migrated or acceptable to lose before proceeding. Returns HTTP 204 with empty body on success. |
| `SALESFORCE_DELETE_FILE` | Delete file | Tool to permanently delete a file from Salesforce. Use when you need to remove a file and its content. This operation cannot be undone. |
| `SALESFORCE_DELETE_JOB_QUERY` | Delete job query | Tool to delete a Salesforce Bulk API v2 query job. Use when you need to permanently remove a job and its associated data. Only the user who created the job can delete it, and the job must be in a completed state. |
| `SALESFORCE_DELETE_LEAD` | Delete lead | Permanently deletes a lead from Salesforce. This action cannot be undone. |
| `SALESFORCE_DELETE_NOTE` | Delete note | Permanently deletes a note from Salesforce. This action cannot be undone. |
| `SALESFORCE_DELETE_OPPORTUNITY` | Delete opportunity | Permanently deletes an opportunity from Salesforce. This action cannot be undone. |
| `SALESFORCE_DELETE_SOBJECT` | Delete sObject record | Tool to delete a single Salesforce record by its ID. Use when you need to permanently remove a specific record from Salesforce. This operation is idempotent - deleting the same record multiple times returns success. Works with standard and custom objects. |
| `SALESFORCE_DELETE_SOBJECT_COLLECTIONS` | Delete multiple records (SObject Collections) | Tool to delete up to 200 records in one request with optional rollback. Use when you need to delete multiple records efficiently, reducing API calls. |
| `SALESFORCE_EXECUTE_SOBJECT_QUICK_ACTION` | Execute sObject Quick Action | Tool to execute a specific quick action on an sObject to create records with pre-configured defaults. Use when you need to leverage Salesforce Quick Actions to streamline record creation with field mappings and default values. |
| `SALESFORCE_EXECUTE_SOSL_SEARCH` | Execute SOSL search | Execute a SOSL search to search across multiple Salesforce objects. Use when you need to search for text across multiple object types simultaneously. |
| `SALESFORCE_GET_A_BATCH_OF_RECORDS` | Get batch of UI API records | Tool to retrieve multiple Salesforce records in a single request with customizable field selection. Use when you need to fetch data for multiple records at once (up to 200 records). |
| `SALESFORCE_GET_ACCOUNT` | Get account | Retrieves a specific account by ID from Salesforce, returning all available fields. |
| `SALESFORCE_GET_ALL_CUSTOM_OBJECTS` | Get all objects | Retrieves all Salesforce objects (standard and custom) with detailed metadata. Each object includes a 'custom' field to identify custom objects. Use when you need to discover available objects or their capabilities. |
| `SALESFORCE_GET_ALL_FIELDS_FOR_OBJECT` | Get all fields for an object | Retrieves all fields (standard and custom) for a Salesforce object with complete metadata including field types, constraints, picklist values, and relationships. |
| `SALESFORCE_GET_ALL_NAVIGATION_ITEMS` | Get all navigation items | Gets all navigation items (tabs) that the user has access to. Use when you need to retrieve available navigation tabs for display or navigation purposes. |
| `SALESFORCE_GET_API` | Get API resources by version | Tool to discover available REST API resources for a specified Salesforce API version. Use when you need to find available endpoints and their URIs for a specific API version. |
| `SALESFORCE_GET_APP` | Get an app | Tool to get metadata about a specific Salesforce app by ID. Use when you need to retrieve app configuration details and navigation items for a particular application. |
| `SALESFORCE_GET_APPS` | Get apps | Tool to get metadata for all apps a user has access to. Use when you need to list available Salesforce applications or check app navigation items. Metadata for the selected app includes tabs on the app's navigation bar, while other apps don't include tab details. |
| `SALESFORCE_GET_CAMPAIGN` | Get campaign | Retrieves a specific campaign by ID from Salesforce, returning all available fields. |
| `SALESFORCE_GET_CHATTER_RESOURCES` | Get Chatter resources | Tool to access Chatter resources directory. Use when you need to discover available Chatter feeds, groups, users, email digest controls, emojis, extensions, or streams. |
| `SALESFORCE_GET_CHILD_RECORDS` | Get child records | Tool to get child records for a specified parent record and child relationship name. Use when you need to retrieve related records from a parent-child relationship in Salesforce, such as getting all Contacts for an Account or all Opportunities for an Account. Results are paginated with configurable page size. |
| `SALESFORCE_GET_COMPACT_LAYOUTS` | Get Compact Layouts | Tool to retrieve compact layout information for multiple Salesforce objects. Use when you need to display object data in compact form for Lightning Experience, mobile apps, or custom interfaces. |
| `SALESFORCE_GET_COMPOSITE_RESOURCES` | Get composite resources | Tool to retrieve a list of available composite resources in Salesforce. Use when you need to discover which composite API endpoints are available for batch operations. |
| `SALESFORCE_GET_COMPOSITE_SOBJECTS` | Get multiple records by IDs | Retrieves multiple records of the same object type by IDs with a request body. Use when you need to retrieve more records than URL length limits allow (up to 2000 records vs ~800 via GET). |
| `SALESFORCE_GET_CONSENT_ACTION` | Get consent preferences | Tool to retrieve aggregated consent preferences across multiple records for a specific action. Use when you need to check if users have consented to email, tracking, fax, or other actions across Contact, Lead, User, Person Account, or Individual objects. |
| `SALESFORCE_GET_CONTACT` | Get contact | Retrieves a specific contact by ID from Salesforce, returning all available fields. |
| `SALESFORCE_GET_CONTACT_BY_ID` | Retrieve specific contact by id | Retrieves a Salesforce Contact by its unique ID; the ID must correspond to an existing Contact record in Salesforce. |
| `SALESFORCE_GET_DASHBOARD` | Get dashboard | Gets detailed metadata for a specific dashboard including its components, layout, and filters. |
| `SALESFORCE_GET_FILE_CONTENT` | Get file content | Returns the binary content of a Salesforce file, including references to external files. Use when you need to download or retrieve the actual file data from Salesforce. |
| `SALESFORCE_GET_FILE_INFORMATION` | Get file information | Tool to retrieve comprehensive metadata and information about a specified file in Salesforce. Use when you need detailed file information including ownership, sharing settings, download URLs, and rendition status. |
| `SALESFORCE_GET_FILE_SHARES` | Get file shares | Returns information about the objects with which the specified file has been shared. Use when you need to understand who has access to a specific file in Salesforce. |
| `SALESFORCE_GET_GLOBAL_ACTIONS` | Get global actions | Tool to retrieve actions displayed in the Salesforce Global Actions menu with metadata. Use when you need to discover available global actions, quick actions, or custom buttons in the UI. |
| `SALESFORCE_GET_JOB_FAILED_RECORD_RESULTS` | Get job failed record results | Tool to retrieve failed records from a Salesforce Bulk API 2.0 ingest job. Use when you need to get records that failed during a bulk operation, including error messages and original data. |
| `SALESFORCE_GET_JOB_SUCCESSFUL_RECORD_RESULTS` | Get job successful record results | Tool to retrieve successfully processed records from a Salesforce Bulk API 2.0 ingest job. Use when you need to get records that were successfully created or updated during a bulk operation. |
| `SALESFORCE_GET_JOB_UNPROCESSED_RECORD_RESULTS` | Get job unprocessed record results | Tool to retrieve unprocessed records from a Salesforce Bulk API 2.0 ingest job. Use when you need to get records that were not processed during a bulk operation, typically due to job abortion or interruption. |
| `SALESFORCE_GET_LAST_SELECTED_APP` | Get last selected app | Retrieves the app the current user last selected or the app the user sees by default. Use when you need to determine which application the user is currently working in or should be using. |
| `SALESFORCE_GET_LEAD` | Get lead | Retrieves a specific lead by ID from Salesforce, returning all available fields. |
| `SALESFORCE_GET_LIST_VIEW_ACTIONS` | Get List View Header Actions | Tool to retrieve header actions on list views. Use when you need to get available actions, buttons, and quick actions displayed on a specific list view header in Salesforce. |
| `SALESFORCE_GET_LIST_VIEW_METADATA_BATCH` | Get batch of list view metadata | Tool to retrieve metadata for multiple list views in a single batch request. Use when you need to get list view configuration, columns, filters, and sorting for multiple list views at once. |
| `SALESFORCE_GET_LIST_VIEW_METADATA_BY_NAME` | Get list view metadata | Returns list view metadata by object and list view API name. Use when you need to retrieve complete metadata information for a specific list view, including display columns, filters, sort order, permissions, and user preferences. |
| `SALESFORCE_GET_LIST_VIEW_RECORDS_BY_ID` | Get list view records by ID | Returns record data for a list view by its ID. Use when you need to retrieve records from a specific Salesforce list view. |
| `SALESFORCE_GET_LIST_VIEW_RECORDS_BY_NAME` | Get list view records by API name | Retrieves paginated record data for a specified list view using the object and list view API names. Use when you need to fetch records that match a specific list view's filters and sorting criteria. Returns the same data that powers Lightning Experience list views. |
| `SALESFORCE_GET_LIST_VIEW_RESULTS` | Get list view results | Retrieves the results of a list view for a specified sObject. Returns column definitions and record data with a 2,000 record limit per response. |
| `SALESFORCE_GET_LOOKUP_FIELD_SUGGESTIONS` | Get lookup field suggestions | Tool to retrieve lookup field suggestions for editing lookup fields with search filtering. Use when searching for records to populate a lookup field, supporting typeahead, recent, and full-text search. |
| `SALESFORCE_GET_LOOKUP_SUGGESTIONS_CASE_CONTACT` | Get lookup field suggestions with POST | Tool to get lookup field suggestions with POST request. Use when editing lookup fields with dependent lookup filtering or when you need to pass source record context in the request body. |
| `SALESFORCE_GET_MRU_LIST_VIEW_METADATA` | Get MRU list view metadata | Tool to retrieve MRU list view metadata for a Salesforce object. Use when you need to understand the structure and configuration of the most recently used list view for an object. |
| `SALESFORCE_GET_MRU_LIST_VIEW_RECORDS` | Get most recently used list view records | Tool to retrieve record data for an object's most recently used (MRU) list view. Use when you need to get the records that a user has recently accessed for a specific Salesforce object type. |
| `SALESFORCE_GET_NOTE` | Get note | Retrieves a specific note by ID from Salesforce, returning all available fields. Notes with IsPrivate=true require the integration user to have sufficient permissions; inaccessible private notes will not be returned. |
| `SALESFORCE_GET_OBJECT_LIST_VIEWS` | Get list views for an object | Returns a collection of list views associated with a Salesforce object. Use when you need to discover available list views for an object like Account, Contact, or Opportunity. |
| `SALESFORCE_GET_OPPORTUNITY` | Get opportunity | Retrieves a specific opportunity by ID from Salesforce, returning all available fields. |
| `SALESFORCE_GET_ORG_LIMITS` | Get organization limits | Tool to retrieve organization limits with max and remaining allocations. Use when you need to check API usage, storage limits, or other resource consumption in Salesforce. |
| `SALESFORCE_GET_PHOTO_ACTIONS` | Get photo actions | Tool to retrieve available photo actions for Salesforce pages. Use when you need to get photo management actions for user or group pages. Currently, only group and user pages support photo actions. |
| `SALESFORCE_GET_PICKLIST_VALUES_BY_RECORD_TYPE` | Get Values for All Picklist Fields | Tool to get values for all picklist fields of a record type, including dependent picklists. Use when you need to retrieve available picklist options for a specific object and record type, especially for dependent picklist hierarchies. |
| `SALESFORCE_GET_QUERY_JOB_INFO` | Get job info query | Tool to retrieve information about a Salesforce Bulk API v2 query job. Use when you need to check the status and details of a query job. |
| `SALESFORCE_GET_QUERY_JOB_RESULTS` | Get job query result | Retrieves results for a completed Bulk API v2 query job in CSV format. Supports pagination for large datasets via maxRecords and locator parameters. |
| `SALESFORCE_GET_QUICK_ACTIONS` | Get quick actions | Tool to retrieve global and object-specific quick actions from Salesforce. Use when you need to list all available quick actions in the organization. |
| `SALESFORCE_GET_RECORD_COUNTS` | Get record count for objects | Tool to retrieve total record counts for specified Salesforce objects. Use when you need to check storage usage or understand data volume for specific sObjects. |
| `SALESFORCE_GET_RECORD_EDIT_PAGE_ACTIONS` | Get record edit page actions | Tool to get available actions on record edit pages. Use when you need to retrieve metadata about actions (standard actions, custom actions, quick actions, productivity actions) displayed on the record edit page for specific records. |
| `SALESFORCE_GET_RELATED_LIST_ACTIONS` | Get related list actions | Tool to get actions on related lists for record detail pages. Use when you need to retrieve metadata about all available actions (standard buttons, quick actions, custom buttons, and productivity actions) that can be performed on records within a specific related list context. |
| `SALESFORCE_GET_RELATED_LIST_PREFERENCES_BATCH` | Get batch of related list user preferences | Tool to get a batch of related list user preferences from Salesforce. Use when retrieving display preferences, column widths, or sort orders for multiple related lists simultaneously. |
| `SALESFORCE_GET_RELATED_LIST_RECORDS_CONTACTS` | Get related list records with request body | Tool to retrieve related list records with request body parameters for filtering and pagination. Use when you need to get records from a related list associated with a parent record with complex query parameters. Returns up to 1,999 records per related list with pagination support. |
| `SALESFORCE_GET_SEARCH_LAYOUT` | Get search result layouts | Retrieves search result layout information for specified sObjects. Use when you need to understand which fields are displayed in search results for objects. |
| `SALESFORCE_GET_SEARCH_SUGGESTIONS` | Search suggested queries | Returns a list of suggested searches based on the user's query string. Use when you want to help users discover relevant search terms before performing a search. |
| `SALESFORCE_GET_SOBJECT_BY_EXTERNAL_ID` | Get sObject by external ID | Tool to retrieve a Salesforce record by matching an external ID field value. Use when you need to find a record using a custom external identifier instead of the Salesforce ID. The field specified must be marked as an External ID in Salesforce. |
| `SALESFORCE_GET_SOBJECT_COLLECTIONS` | Get multiple sObject records | Tool to retrieve multiple records of the same sObject type in a single API call. Use when you need to fetch up to 200 records by their IDs. Returns an array of sObjects with the specified fields. |
| `SALESFORCE_GET_SOBJECT_LIST_VIEW` | Get sObject list view information | Tool to retrieve basic information about a specific list view for an sObject. Use when you need to get list view metadata including its ID, label, developer name, and URLs for accessing results and detailed descriptions. |
| `SALESFORCE_GET_SOBJECT_LIST_VIEWS` | Get list views for sObject | Tool to retrieve list views for a specified sObject. Use when you need to discover available filtered views of records for objects like Account, Contact, Lead, or Opportunity. |
| `SALESFORCE_GET_SOBJECT_PLATFORMACTION` | Get PlatformAction SObject metadata | Retrieves metadata description of PlatformAction SObject. Use when you need to understand the structure and fields of PlatformAction for querying UI actions. |
| `SALESFORCE_GET_S_OBJECT_QUICK_ACTION_DEFAULT_VALUES` | Get sObject Quick Action Default Values by ID | Retrieves default field values for a quick action in a specific record context. Use when you need to pre-populate fields when creating related records through quick actions. |
| `SALESFORCE_GET_SOBJECT_QUICK_ACTION_DEFAULT_VALUES` | Get sObject Quick Action Default Values | Retrieves default field values for a specific quick action on an sObject. Use when you need to understand what fields will be automatically populated when executing the quick action. |
| `SALESFORCE_GET_S_OBJECT_RECORD` | Get sObject record by ID | Tool to retrieve a single Salesforce record by ID from any sObject type. Use when you need to get detailed information about a specific record. |
| `SALESFORCE_GET_SOBJECT_RELATIONSHIP` | Get records using sObject relationships | Retrieves records by traversing sObject relationships using friendly URLs. Use when you need to get related records through a relationship field (e.g., all Contacts for an Account). |
| `SALESFORCE_GET_S_OBJECTS_DESCRIBE_LAYOUTS_RECORD_TYPE_ID` | Get layouts for object with record type | Tool to retrieve layout metadata for a specific record type on an object. Use when you need detailed information about page layouts, field positioning, sections, quick actions, related lists, and buttons for a particular record type. |
| `SALESFORCE_GET_SOBJECTS_SOBJECT_DESCRIBE_APPROVALLAYOUTS` | Get approval layouts for object | Retrieves approval layouts for a specified Salesforce object. Use when you need to understand which fields are displayed in approval pages or to dynamically build approval interfaces. |
| `SALESFORCE_GET_S_OBJECTS_UPDATED` | Get updated sObject records | Tool to retrieve a list of sObject records that have been updated within a given timeframe. Use when you need to synchronize records or track changes to specific sObject types over a time period. |
| `SALESFORCE_GET_SUPPORT` | Get support knowledge | Retrieves the root of the Support Knowledge REST API. Use when you need to access knowledge articles and data category information. |
| `SALESFORCE_GET_SUPPORTED_OBJECTS_DIRECTORY` | Get directory of supported objects | Tool to get a Salesforce org's active theme and directory of supported objects. Use when you need to discover available objects that are supported by the User Interface API, including their CRUD permissions, labels, and theme information. |
| `SALESFORCE_GET_SUPPORT_KNOWLEDGE_ARTICLES` | Get support knowledge articles | Retrieves user's visible knowledge articles and data categories from Salesforce Knowledge. Use when you need to access published, draft, or archived articles based on user permissions. |
| `SALESFORCE_GET_THEME` | Get theme | Tool to get icons and colors for Salesforce UI themes. Use when you need to retrieve theme information for objects in the organization. |
| `SALESFORCE_GET_UI_API_ACTIONS_LOOKUP_ACCOUNT` | Get lookup field actions | Tool to get lookup field actions for a Salesforce object. Use when you need to retrieve available actions for lookup fields on a specific object type (e.g., Account, Contact). |
| `SALESFORCE_GET_UIAPI_ACTIONS_MRU_LIST_ACCOUNT` | Get MRU List View Actions | Tool to retrieve header actions available on the MRU (Most Recently Used) list view for a specified Salesforce object. Use when you need to get available actions, buttons, and quick actions for an object's list view. |
| `SALESFORCE_GET_UI_API_ACTIONS_RECORD_RELATED_LIST` | Get related list actions | Tool to get available actions on related lists for a record detail page. Use when you need to retrieve metadata about actions (standard actions, custom actions, quick actions, productivity actions) displayed on related lists for a specific parent record. |
| `SALESFORCE_GET_UI_API_APPS_USER_NAV_ITEMS` | Get Personalized Navigation Items | Tool to get personalized navigation items for a specific Salesforce app. Use when you need to retrieve the navigation tabs that a user has access to within an application. |
| `SALESFORCE_GET_UIAPI_LIST_INFO_ACCOUNT_ALL_ACCOUNTS` | Get Account AllAccounts list view metadata | Retrieves list view metadata for the Account AllAccounts view using Salesforce UI API. Use when you need to understand the structure, columns, filters, and sorting of the standard AllAccounts list view. |
| `SALESFORCE_GET_UIAPI_LIST_INFO_ACCOUNT_RECENT` | Get List View Metadata | Tool to get list view metadata from Salesforce UI API. Use when you need to retrieve configuration details for a list view including columns, filters, sorting, and permissions. |
| `SALESFORCE_GET_UIAPI_LIST_INFO_ACCOUNT_SEARCH_RESULT` | Get Account SearchResult list view metadata | Retrieves list view metadata for the Account __SearchResult view using Salesforce UI API. Use when you need to understand the structure, columns, filters, and sorting of search results for Accounts. |
| `SALESFORCE_GET_UI_API_LIST_INFO_RECENT` | Get List Views for Object | Tool to get list views for a Salesforce object. Use when you need to retrieve available list views with options to filter by recent usage and search. |
| `SALESFORCE_GET_UI_API_RECORD_UI` | Get record UI data and metadata | Tool to retrieve layout, field metadata, and record data in a single response. Use when you need comprehensive information including UI layout configuration, object metadata, and actual record values with child relationships. |
| `SALESFORCE_GET_UIAPI_RELATED_LIST_PREFERENCES` | Get related list user preferences | Tool to retrieve user preferences for a specific related list on an object. Use when you need to get display settings, column widths, or sort preferences for related lists in Salesforce UI. |
| `SALESFORCE_GET_USER_INFO` | Get user info | Retrieves information about the current user or a specific user in Salesforce. |
| `SALESFORCE_HEAD_ACTIONS_CUSTOM` | Get custom actions headers | Tool to return HTTP headers for custom invocable actions without response body. Use when you need to check resource availability and metadata before executing full requests or to validate resource state conditionally. |
| `SALESFORCE_HEAD_ACTIONS_STANDARD` | Get standard actions headers | Tool to return HTTP headers for standard invocable actions metadata without response body. Use when you need to perform efficient cache validation, check for metadata changes, or reduce bandwidth usage before retrieving full action metadata. |
| `SALESFORCE_HEAD_APPMENU_SALESFORCE1` | Get AppMenu Salesforce1 headers | Tool to return HTTP headers for AppMenu Salesforce1 mobile navigation items without response body. Use when you need to check resource metadata, validate cache (via ETag or Last-Modified), or test endpoint availability without data transfer overhead. |
| `SALESFORCE_HEAD_PROCESS_RULES_S_OBJECT` | Get process rules headers | Tool to return HTTP headers for process rules of an sObject without retrieving the response body. Use when you need to check if process rules exist for an sObject or retrieve metadata like ETag and Last-Modified headers. |
| `SALESFORCE_HEAD_QUICK_ACTIONS` | Get Quick Actions headers | Tool to return HTTP headers for Quick Actions resource without response body. Use when you need to inspect metadata before retrieving full Quick Actions content or to validate resource availability. |
| `SALESFORCE_HEAD_SOBJECT_QUICK_ACTION_DEFAULT_VALUES` | Get quick action default values headers by ID | Tool to return HTTP headers for sObject quick action default values by context ID without response body. Use when you need to check resource availability, verify cache validation headers (ETag, Last-Modified), or optimize API calls by avoiding unnecessary data transfer. |
| `SALESFORCE_HEAD_SOBJECTS_GLOBAL_DESCRIBE_LAYOUTS` | Get global publisher layouts headers | Tool to return HTTP headers for all global publisher layouts without response body. Use when implementing cache validation strategies, efficient resource polling, or checking if layouts have been modified without transferring layout data. |
| `SALESFORCE_HEAD_SOBJECTS_QUICK_ACTION` | Get sObject quick action headers | Tool to return HTTP headers for a specific sObject quick action without response body. Use when you need to check ETag or Last-Modified headers before fetching full content or to validate quick action availability. |
| `SALESFORCE_HEAD_SOBJECTS_USER_PASSWORD` | Get User password headers | Tool to return HTTP headers for User password resource without response body. Use when you need to check user password metadata and expiration status efficiently without retrieving the full response content. |
| `SALESFORCE_LIST_ACCOUNTS` | List accounts | Lists accounts from Salesforce using SOQL query, allowing flexible filtering, sorting, and field selection. Results paginate via nextRecordsUrl with up to ~2000 rows per page. REQUEST_LIMIT_EXCEEDED requires exponential backoff; INVALID_FIELD or INSUFFICIENT_ACCESS_OR_READONLY errors indicate profile or field-level restrictions — simplify SELECT/WHERE clauses. |
| `SALESFORCE_LIST_ANALYTICS_TEMPLATES` | List Analytics templates | Tool to list CRM Analytics templates available in the org. Use when you need to discover available templates for creating Analytics apps. |
| `SALESFORCE_LIST_CAMPAIGNS` | List campaigns | Lists campaigns from Salesforce using SOQL query, allowing flexible filtering, sorting, and field selection. Results returned under `response_data.records`; use `Id` (not `Name`) to identify campaigns in downstream operations. |
| `SALESFORCE_LIST_CONTACTS` | List contacts | Lists contacts from Salesforce using SOQL query, allowing flexible filtering, sorting, and field selection. Results are returned under `response_data.records`; check `response_data.done` and `response_data.totalSize` for pagination — use OFFSET or `nextRecordsUrl` until `done=true` to retrieve all records. |
| `SALESFORCE_LIST_CUSTOM_INVOCABLE_ACTIONS` | Get custom invocable actions | Retrieves the list of custom actions including Flow actions, Apex actions, and invocable processes. Use when you need to discover available custom invocable actions in your Salesforce organization. |
| `SALESFORCE_LIST_DASHBOARDS` | List dashboards | Lists all dashboards available in Salesforce with basic metadata including name, ID, and URLs. |
| `SALESFORCE_LIST_EMAIL_TEMPLATES` | List email templates | Lists available email templates in Salesforce with filtering and search capabilities. |
| `SALESFORCE_LIST_LEADS` | List leads | Lists leads from Salesforce using SOQL query, allowing flexible filtering, sorting, and field selection. Results are paginated; follow nextRecordsUrl in the response to retrieve subsequent pages — the first page may silently omit matching records beyond the page limit. |
| `SALESFORCE_LIST_NOTES` | List notes | Lists notes from Salesforce using SOQL query, allowing flexible filtering, sorting, and field selection. Designed specifically for Note and ContentNote objects. |
| `SALESFORCE_LIST_OPPORTUNITIES` | List opportunities | Lists opportunities from Salesforce using SOQL query, allowing flexible filtering, sorting, and field selection. Results are paginated up to ~2000 rows per batch; check `done`, `totalSize`, and `nextRecordsUrl` fields to detect and retrieve additional pages, or use a SOQL `LIMIT` clause to cap results. For complex queries rejected by this tool, use `SALESFORCE_RUN_SOQL_QUERY` instead. |
| `SALESFORCE_LIST_PRICEBOOK_ENTRIES` | List pricebook entries | Lists pricebook entries from Salesforce using SOQL query, allowing flexible filtering, sorting, and field selection. Use this to map product names to pricebook entry IDs needed for opportunity line items. When using returned IDs with SALESFORCE_ADD_OPPORTUNITY_LINE_ITEM, always filter with WHERE IsActive = true — inactive entries cause REQUIRED_FIELD_MISSING or INVALID_CROSS_REFERENCE_KEY errors. |
| `SALESFORCE_LIST_PRICEBOOKS` | List pricebooks | Lists pricebooks from Salesforce using SOQL query, allowing flexible filtering, sorting, and field selection. Use this to map pricebook names to IDs. |
| `SALESFORCE_LIST_REPORTS` | List reports | Lists all reports available in Salesforce with basic metadata including name, ID, and URLs. |
| `SALESFORCE_LIST_STANDARD_INVOCABLE_ACTIONS` | Get standard invocable actions | Retrieves the list of standard actions that can be statically invoked. Use when you need to discover available standard invocable actions like posting to Chatter, sending email, or sending custom notifications. |
| `SALESFORCE_LOG_CALL` | Log call | Logs a completed phone call as a task in Salesforce with call-specific details like duration, type, and disposition. |
| `SALESFORCE_LOG_EMAIL_ACTIVITY` | Log email activity | Creates an EmailMessage record to log email activity in Salesforce, associating it with related records. Requires EmailMessage insert permissions enabled at the org level; some orgs block this entirely. |
| `SALESFORCE_MASS_TRANSFER_OWNERSHIP` | Mass transfer ownership | Transfers ownership of multiple records to a new owner in a single operation using Salesforce's composite API for better performance. Operation has no rollback; all provided records are reassigned immediately. |
| `SALESFORCE_PARAMETERIZED_SEARCH` | Parameterized Search | Tool to execute RESTful search using parameters instead of SOSL clause. Use when you need to search across Salesforce objects with simple GET requests (URL parameters) or complex POST requests (JSON body with advanced filtering). POST method supports DataCategories, networks, orderBy constraints, and per-object filtering. |
| `SALESFORCE_PATCH_COMPOSITE_SOBJECTS` | Upsert records using external ID | Tool to upsert up to 200 records using external ID field matching. Use when you need to create or update multiple records efficiently in a single API call based on an external ID field. |
| `SALESFORCE_POST_COMPOSITE_GRAPH` | Execute Composite Graph | Tool to execute multiple related REST API requests in a single transactional call with up to 500 subrequests per graph. Use when you need to perform multiple Salesforce operations atomically where all operations must succeed or fail together. Supports referencing output from one request as input to subsequent requests using @{referenceId.fieldName} syntax. |
| `SALESFORCE_POST_COMPOSITE_SOBJECTS` | Create records using sObject Collections | Tool to create up to 200 records in one request using sObject Collections. Use when you need to create multiple records of potentially different sObject types efficiently in a single API call. |
| `SALESFORCE_POST_PARAMETERIZED_SEARCH` | Parameterized Search | Tool to execute parameterized search across Salesforce objects with advanced filtering. Use when you need to search for records using specific search terms with fine-grained control over which objects to search, which fields to return, and additional filtering criteria. |
| `SALESFORCE_QUERY_ALL` | Query All (including deleted) | Tool to execute SOQL queries including soft-deleted and archived records. Use when you need to query records that have been deleted via merge or delete operations, or when accessing archived Task and Event records. |
| `SALESFORCE_REMOVE_FROM_CAMPAIGN` | Remove from campaign | Removes a lead or contact from a campaign by deleting the CampaignMember record. Provide either the member_id (lead/contact ID) or the specific campaign_member_id. |
| `SALESFORCE_RETRIEVE_LEAD_BY_ID` | Retrieve lead by id | Retrieves details for a Salesforce Lead by its ID; the specified Lead ID must exist in Salesforce. |
| `SALESFORCE_RETRIEVE_OPPORTUNITIES_DATA` | Retrieve opportunities data | Retrieves all available Opportunity records, representing potential revenue-generating deals, from Salesforce. |
| `SALESFORCE_RUN_REPORT` | Run report | Runs a report and returns the results. Creates a report instance that can be checked for completion. Results are returned in a nested structure (factMap, reportExtendedMetadata), not a flat record list; an empty factMap/rows is a valid result. Avoid repeated calls when freshness allows — reuse an existing instance_id instead. |
| `SALESFORCE_RUN_SOQL_QUERY` | Run SOQL query | Executes a SOQL query against Salesforce data. Returns records matching the query with pagination support. |
| `SALESFORCE_SEARCH_ACCOUNTS` | Search accounts | Search for Salesforce accounts using criteria like name, industry, type, location, or contact information. Always provide at least one filter parameter; omitting all filters returns a broad, slow listing. Owner/territory filtering is unsupported — use SALESFORCE_RUN_SOQL_QUERY for ownership-based filters. Use SALESFORCE_GET_ACCOUNT to fetch complete field data for a specific record. Unsupported filter fields may be silently ignored — verify results reflect intended criteria. |
| `SALESFORCE_SEARCH_CAMPAIGNS` | Search campaigns | Search for Salesforce campaigns using multiple criteria like name, type, status, date range, or active status. Requires access to the Campaign object (Marketing User feature must be enabled in the org). For complex sorting (multi-field ORDER BY), use SALESFORCE_RUN_SOQL_QUERY instead. |
| `SALESFORCE_SEARCH_CONTACTS` | Search contacts | Search Salesforce Contact records (not Leads — use SALESFORCE_SEARCH_LEADS for those) using name, email, phone, account, or title. All parameters support partial/fuzzy matching, so results may include unrelated records; post-filter client-side for exact matches. Partial matches and common names can return multiple contacts — always confirm the correct contact by its 18-character Id before passing to write operations like SALESFORCE_LOG_CALL or SALESFORCE_CREATE_TASK. A response with totalSize=0 is a valid 'not found' outcome. Provide at least one search criterion; omitting all returns a broad, slow result set. Returned Ids are 18-character strings and must be used as-is in downstream tools. |
| `SALESFORCE_SEARCH_KNOWLEDGE_ARTICLES` | Search suggested article title matches | Search for Salesforce Knowledge articles with titles matching the search query. Returns auto-suggest results for Knowledge articles based on title matches. |
| `SALESFORCE_SEARCH_LEADS` | Search leads | Search for Salesforce leads using criteria like name, email, phone, company, title, status, or lead source. At least one search criterion should be provided — omitting all parameters results in a broad, slow listing of arbitrary records. Partial matches on name, email, and company may return multiple candidates; confirm Email or Company field values before using a lead ID in downstream operations. |
| `SALESFORCE_SEARCH_NOTES` | Search notes | Search for Salesforce notes using multiple criteria like title, body content, parent record, owner, or creation date. Provide at least one filter criterion — omitting all filters returns a broad, slow, noisy listing. |
| `SALESFORCE_SEARCH_OPPORTUNITIES` | Search opportunities | Search for Salesforce opportunities using multiple criteria like name, account, stage, amount, close date, or status. Apply at least one filter to avoid broad result sets. Partial-match searches may return multiple similar records; verify the correct record by Id before downstream use. |
| `SALESFORCE_SEARCH_TASKS` | Search tasks | Search for Salesforce tasks using multiple criteria like subject, status, priority, assigned user, related records, or dates. Always provide at least one filter criterion — no filters produces broad, slow results. For complex filtering not supported here, use SALESFORCE_RUN_SOQL_QUERY. |
| `SALESFORCE_SEND_EMAIL` | Send email | Sends an email through Salesforce with options for recipients, attachments, and activity logging. Can partially succeed — check per-recipient success/failure status rather than treating the call as all-or-nothing. For large recipient lists, use SALESFORCE_SEND_MASS_EMAIL instead. |
| `SALESFORCE_SEND_EMAIL_FROM_TEMPLATE` | Send email from template | Sends an email using a predefined Salesforce email template with merge field support. |
| `SALESFORCE_SEND_MASS_EMAIL` | Send mass email | Sends bulk emails to multiple recipients immediately and irreversibly using a template or custom content. Requires either a valid template_id or both subject and body; omitting all three causes errors. Processes in batches for performance. Check failedRecipients and summary.failureCount in the response even when success=true, as individual recipient failures can occur without an overall failure. |
| `SALESFORCE_SET_USER_PASSWORD` | Set user password | Tool to set or reset a user's password in Salesforce. Use when you need to assign a specific password or generate a random one for a user. |
| `SALESFORCE_SOBJECT_ROWS_UPDATE` | Update sObject record | Tool to update specific fields in an existing Salesforce sObject record. Use when you need to modify one or more fields in a record without affecting other fields. |
| `SALESFORCE_SOBJECT_USER_PASSWORD` | Get user password expiration status | Tool to check whether a Salesforce user's password has expired. Use when you need to verify password expiration status for a specific user. |
| `SALESFORCE_TOOLING_QUERY` | Execute Tooling API query | Tool to execute SOQL queries against Salesforce Tooling API metadata objects. Use when you need to query metadata components like ApexClass, ApexTrigger, ValidationRule, WorkflowRule, FieldDefinition, or EntityDefinition. The Tooling API exposes objects that use the external object framework and provides granular access to metadata components for development and deployment tasks. |
| `SALESFORCE_UPDATE_ACCOUNT` | Update account | Updates an existing account in Salesforce with the specified changes. Only provided fields will be updated. |
| `SALESFORCE_UPDATE_CAMPAIGN` | Update campaign | Updates an existing campaign in Salesforce with the specified changes. Only provided fields will be updated. |
| `SALESFORCE_UPDATE_CONTACT` | Update contact | Updates an existing contact in Salesforce with the specified changes. Only provided fields will be updated. Returns HTTP 204 with no body on success; use SALESFORCE_GET_CONTACT to verify applied changes. Org-level validation rules, duplicate rules, or field-level permissions may reject correctly formatted requests with HTTP 400; inspect the error response to identify the constraint. |
| `SALESFORCE_UPDATE_FAVORITE` | Update a favorite | Tool to update a favorite's properties in Salesforce UI API. Use when you need to reorder favorites or modify their display properties. |
| `SALESFORCE_UPDATE_LEAD` | Update lead | Updates an existing lead in Salesforce with the specified changes. Only provided fields will be updated. |
| `SALESFORCE_UPDATE_LIST_VIEW_PREFERENCES` | Update list view preferences | Tool to update user preferences for a Salesforce list view including column widths, text wrapping, and display order. Use when you need to customize how columns appear in a list view. |
| `SALESFORCE_UPDATE_NOTE` | Update note | Updates an existing note in Salesforce with the specified changes. Only provided fields will be updated. |
| `SALESFORCE_UPDATE_OPPORTUNITY` | Update opportunity | Updates an existing opportunity in Salesforce with the specified changes. Only provided fields will be updated. Returns HTTP 204 with empty body on success; call SALESFORCE_GET_OPPORTUNITY afterward to read updated values. Updates may fail with FIELD_CUSTOM_VALIDATION_EXCEPTION or REQUIRED_FIELD_MISSING — inspect the error message to identify the offending field. |
| `SALESFORCE_UPDATE_RECORD` | Update a record | Tool to update a record's data in Salesforce via UI API. Use when you need to modify field values on an existing record. Salesforce validation rules are enforced. Pass If-Unmodified-Since header to prevent conflicts. |
| `SALESFORCE_UPDATE_RELATED_LIST_PREFERENCES` | Update Related List Preferences | Tool to update user preferences for a specific related list on an object in Salesforce. Use when customizing display settings such as column widths, text wrapping, column ordering, and sorting preferences for related lists. |
| `SALESFORCE_UPDATE_TASK` | Update task | Updates an existing task in Salesforce with new information. Only provided fields will be updated. |
| `SALESFORCE_UPLOAD_FILE` | Upload file to Salesforce Files | Upload a file to Salesforce Files home via the Connect REST API. Use when you need to attach files to records or store them in a user's personal library. File size limit: 50 MB per request. |
| `SALESFORCE_UPLOAD_JOB_DATA` | Upload job data | Tool to upload CSV data to a Salesforce Bulk API v2 ingest job. Use after creating a job and before closing it. Only ONE upload is allowed per job - multiple uploads will fail. After upload, close the job with state 'UploadComplete' to begin processing. |
| `SALESFORCE_UPSERT_SOBJECT_BY_EXTERNAL_ID` | Upsert sObject by External ID | Tool to upsert records using sObject Rows by External ID. Use when you need to create or update a Salesforce record based on an external ID field value - creates a new record if the external ID doesn't exist, or updates the existing record if it does. |

## Supported Triggers

| Trigger slug | Name | Description |
|---|---|---|
| `SALESFORCE_ACCOUNT_CREATED_OR_UPDATED_TRIGGER` | Account Created or Updated | Triggers when an Account is created or updated in Salesforce. Uses LastModifiedDate high-watermark to capture both creations and updates. |
| `SALESFORCE_CONTACT_UPDATED_TRIGGER` | Contact Updated | Triggers when an existing Salesforce Contact record is modified. Emits changed fields alongside relevant timestamps. |
| `SALESFORCE_GENERIC_S_OBJECT_RECORD_UPDATED_TRIGGER` | Record Updated (Generic SObject) | Triggers when monitored fields change on any Salesforce SObject. You specify the SObject type and which field values should be returned in the payload. The trigger uses SystemModstamp to detect changes regardless of which specific field changed. |
| `SALESFORCE_NEW_CONTACT_TRIGGER` | New Contact Trigger | Triggers when a new Contact is Created in Salesforce. |
| `SALESFORCE_NEW_LEAD_TRIGGER` | New Lead Trigger | Triggers when a new Lead is created in Salesforce. |
| `SALESFORCE_NEW_OR_UPDATED_OPPORTUNITY_TRIGGER` | New or Updated Opportunity | Triggers when a Salesforce Opportunity is created or updated. |
| `SALESFORCE_TASK_CREATED_OR_COMPLETED_TRIGGER` | Task Created or Completed | Triggers when a Task is created or when its status changes to Completed in Salesforce. Supports optional filtering by task Status or Subject. |

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

The Salesforce MCP server is an implementation of the Model Context Protocol that connects your AI agent to Salesforce. It provides structured and secure access so your agent can perform Salesforce 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

Before starting, make sure you have:
- Composio API Key and OpenAI API Key
- Primary know-how of OpenAI Agents SDK
- A live Salesforce project
- Some knowledge of Python or Typescript

### 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).
- Go to Settings and copy your API key.

### 2. Install dependencies

Install the Composio SDK and the OpenAI Agents SDK.
```python
pip install composio_openai_agents openai-agents python-dotenv
```

```typescript
npm install @composio/openai-agents @openai/agents dotenv
```

### 3. Set up environment variables

Create a .env file and add your OpenAI and Composio API keys.
```bash
OPENAI_API_KEY=sk-...your-api-key
COMPOSIO_API_KEY=your-api-key
USER_ID=composio_user@gmail.com
```

### 4. Import dependencies

What's happening:
- You're importing all necessary libraries.
- The Composio and OpenAIAgentsProvider classes are imported to connect your OpenAI agent to Composio tools like Salesforce.
```python
import asyncio
import os
from dotenv import load_dotenv

from composio import Composio
from composio_openai_agents import OpenAIAgentsProvider
from agents import Agent, Runner, HostedMCPTool, SQLiteSession
```

```typescript
import 'dotenv/config';
import { Composio } from '@composio/core';
import { OpenAIAgentsProvider } from '@composio/openai-agents';
import { Agent, hostedMcpTool, run, OpenAIConversationsSession } from '@openai/agents';
import * as readline from 'readline';
```

### 5. Set up the Composio instance

No description provided.
```python
load_dotenv()

api_key = os.getenv("COMPOSIO_API_KEY")
user_id = os.getenv("USER_ID")

if not api_key:
    raise RuntimeError("COMPOSIO_API_KEY is not set. Create a .env file with COMPOSIO_API_KEY=your_key")

# Initialize Composio
composio = Composio(api_key=api_key, provider=OpenAIAgentsProvider())
```

```typescript
dotenv.config();

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

if (!composioApiKey) {
  throw new Error('COMPOSIO_API_KEY is not set. Create a .env file with COMPOSIO_API_KEY=your_key');
}
if (!userId) {
  throw new Error('USER_ID is not set');
}

// Initialize Composio
const composio = new Composio({
  apiKey: composioApiKey,
  provider: new OpenAIAgentsProvider(),
});
```

### 6. Create a Tool Router session

What is happening:
- You give the Tool Router the user id and the toolkits you want available. Here, it is only salesforce.
- The router checks the user's Salesforce connection and prepares the MCP endpoint.
- The returned session.mcp.url is the MCP URL that your agent will use to access Salesforce.
- This approach keeps things lightweight and lets the agent request Salesforce tools only when needed during the conversation.
```python
# Create a Salesforce Tool Router session
session = composio.create(
    user_id=user_id,
    toolkits=["salesforce"]
)

mcp_url = session.mcp.url
```

```typescript
// Create Tool Router session for Salesforce
const session = await composio.create(userId as string, {
  toolkits: ['salesforce'],
});
const mcpUrl = session.mcp.url;
```

### 7. Configure the agent

No description provided.
```python
# Configure agent with MCP tool
agent = Agent(
    name="Assistant",
    model="gpt-5",
    instructions=(
        "You are a helpful assistant that can access Salesforce. "
        "Help users perform Salesforce operations through natural language."
    ),
    tools=[
        HostedMCPTool(
            tool_config={
                "type": "mcp",
                "server_label": "tool_router",
                "server_url": mcp_url,
                "headers": {"x-api-key": api_key},
                "require_approval": "never",
            }
        )
    ],
)
```

```typescript
// Configure agent with MCP tool
const agent = new Agent({
  name: 'Assistant',
  model: 'gpt-5',
  instructions:
    'You are a helpful assistant that can access Salesforce. Help users perform Salesforce operations through natural language.',
  tools: [
    hostedMcpTool({
      serverLabel: 'tool_router',
      serverUrl: mcpUrl,
      headers: { 'x-api-key': composioApiKey },
      requireApproval: 'never',
    }),
  ],
});
```

### 8. Start chat loop and handle conversation

No description provided.
```python
print("\nComposio Tool Router session created.")

chat_session = SQLiteSession("conversation_openai_toolrouter")

print("\nChat started. Type your requests below.")
print("Commands: 'exit', 'quit', or 'q' to end\n")

async def main():
    try:
        result = await Runner.run(
            agent,
            "What can you help me with?",
            session=chat_session
        )
        print(f"Assistant: {result.final_output}\n")
    except Exception as e:
        print(f"Error: {e}\n")

    while True:
        user_input = input("You: ").strip()
        if user_input.lower() in {"exit", "quit", "q"}:
            print("Goodbye!")
            break

        result = await Runner.run(
            agent,
            user_input,
            session=chat_session
        )
        print(f"Assistant: {result.final_output}\n")

asyncio.run(main())
```

```typescript
// Keep conversation state across turns
const conversationSession = new OpenAIConversationsSession();

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

console.log('\nComposio Tool Router session created.');
console.log('\nChat started. Type your requests below.');
console.log("Commands: 'exit', 'quit', or 'q' to end\n");

try {
  const first = await run(agent, 'What can you help me with?', { session: conversationSession });
  console.log(`Assistant: ${first.finalOutput}\n`);
} catch (e) {
  console.error('Error:', e instanceof Error ? e.message : e, '\n');
}

rl.prompt();

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

  if (['exit', 'quit', 'q'].includes(text.toLowerCase())) {
    console.log('Goodbye!');
    rl.close();
    process.exit(0);
  }

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

  try {
    const result = await run(agent, text, { session: conversationSession });
    console.log(`\nAssistant: ${result.finalOutput}\n`);
  } catch (e) {
    console.error('Error:', e instanceof Error ? e.message : e, '\n');
  }

  rl.prompt();
});

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

## Complete Code

```python
import asyncio
import os
from dotenv import load_dotenv

from composio import Composio
from composio_openai_agents import OpenAIAgentsProvider
from agents import Agent, Runner, HostedMCPTool, SQLiteSession

load_dotenv()

api_key = os.getenv("COMPOSIO_API_KEY")
user_id = os.getenv("USER_ID")

if not api_key:
    raise RuntimeError("COMPOSIO_API_KEY is not set. Create a .env file with COMPOSIO_API_KEY=your_key")

# Initialize Composio
composio = Composio(api_key=api_key, provider=OpenAIAgentsProvider())

# Create Tool Router session
session = composio.create(
    user_id=user_id,
    toolkits=["salesforce"]
)
mcp_url = session.mcp.url

# Configure agent with MCP tool
agent = Agent(
    name="Assistant",
    model="gpt-5",
    instructions=(
        "You are a helpful assistant that can access Salesforce. "
        "Help users perform Salesforce operations through natural language."
    ),
    tools=[
        HostedMCPTool(
            tool_config={
                "type": "mcp",
                "server_label": "tool_router",
                "server_url": mcp_url,
                "headers": {"x-api-key": api_key},
                "require_approval": "never",
            }
        )
    ],
)

print("\nComposio Tool Router session created.")

chat_session = SQLiteSession("conversation_openai_toolrouter")

print("\nChat started. Type your requests below.")
print("Commands: 'exit', 'quit', or 'q' to end\n")

async def main():
    try:
        result = await Runner.run(
            agent,
            "What can you help me with?",
            session=chat_session
        )
        print(f"Assistant: {result.final_output}\n")
    except Exception as e:
        print(f"Error: {e}\n")

    while True:
        user_input = input("You: ").strip()
        if user_input.lower() in {"exit", "quit", "q"}:
            print("Goodbye!")
            break

        result = await Runner.run(
            agent,
            user_input,
            session=chat_session
        )
        print(f"Assistant: {result.final_output}\n")

asyncio.run(main())
```

```typescript
import 'dotenv/config';
import { Composio } from '@composio/core';
import { OpenAIAgentsProvider } from '@composio/openai-agents';
import { Agent, hostedMcpTool, run, OpenAIConversationsSession } from '@openai/agents';
import * as readline from 'readline';

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

if (!composioApiKey) {
  throw new Error('COMPOSIO_API_KEY is not set. Create a .env file with COMPOSIO_API_KEY=your_key');
}
if (!userId) {
  throw new Error('USER_ID is not set');
}

// Initialize Composio
const composio = new Composio({
  apiKey: composioApiKey,
  provider: new OpenAIAgentsProvider(),
});

async function main() {
  // Create Tool Router session
  const session = await composio.create(userId as string, {
    toolkits: ['salesforce'],
  });
  const mcpUrl = session.mcp.url;

  // Configure agent with MCP tool
  const agent = new Agent({
    name: 'Assistant',
    model: 'gpt-5',
    instructions:
      'You are a helpful assistant that can access Salesforce. Help users perform Salesforce operations through natural language.',
    tools: [
      hostedMcpTool({
        serverLabel: 'tool_router',
        serverUrl: mcpUrl,
        headers: { 'x-api-key': composioApiKey },
        requireApproval: 'never',
      }),
    ],
  });

  // Keep conversation state across turns
  const conversationSession = new OpenAIConversationsSession();

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

  console.log('\nComposio Tool Router session created.');
  console.log('\nChat started. Type your requests below.');
  console.log("Commands: 'exit', 'quit', or 'q' to end\n");

  try {
    const first = await run(agent, 'What can you help me with?', { session: conversationSession });
    console.log(`Assistant: ${first.finalOutput}\n`);
  } catch (e) {
    console.error('Error:', e instanceof Error ? e.message : e, '\n');
  }

  rl.prompt();

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

    if (['exit', 'quit', 'q'].includes(text.toLowerCase())) {
      console.log('Goodbye!');
      rl.close();
      process.exit(0);
    }

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

    try {
      const result = await run(agent, text, { session: conversationSession });
      console.log(`\nAssistant: ${result.finalOutput}\n`);
    } catch (e) {
      console.error('Error:', e instanceof Error ? e.message : e, '\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

This was a starter code for integrating Salesforce MCP with OpenAI Agents SDK to build a functional AI agent that can interact with Salesforce.
Key features:
- Hosted MCP tool integration through Composio's Tool Router
- SQLite session persistence for conversation history
- Simple async chat loop for interactive testing
You can extend this by adding more toolkits, implementing custom business logic, or building a web interface around the agent.

## How to build Salesforce MCP Agent with another framework

- [ChatGPT](https://composio.dev/toolkits/salesforce/framework/chatgpt)
- [Claude Agent SDK](https://composio.dev/toolkits/salesforce/framework/claude-agents-sdk)
- [Claude Code](https://composio.dev/toolkits/salesforce/framework/claude-code)
- [Claude Cowork](https://composio.dev/toolkits/salesforce/framework/claude-cowork)
- [Codex](https://composio.dev/toolkits/salesforce/framework/codex)
- [Cursor](https://composio.dev/toolkits/salesforce/framework/cursor)
- [VS Code](https://composio.dev/toolkits/salesforce/framework/vscode)
- [OpenCode](https://composio.dev/toolkits/salesforce/framework/opencode)
- [OpenClaw](https://composio.dev/toolkits/salesforce/framework/openclaw)
- [Hermes](https://composio.dev/toolkits/salesforce/framework/hermes-agent)
- [CLI](https://composio.dev/toolkits/salesforce/framework/cli)
- [Google ADK](https://composio.dev/toolkits/salesforce/framework/google-adk)
- [LangChain](https://composio.dev/toolkits/salesforce/framework/langchain)
- [Vercel AI SDK](https://composio.dev/toolkits/salesforce/framework/ai-sdk)
- [Mastra AI](https://composio.dev/toolkits/salesforce/framework/mastra-ai)
- [LlamaIndex](https://composio.dev/toolkits/salesforce/framework/llama-index)
- [CrewAI](https://composio.dev/toolkits/salesforce/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.
- [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.
- [Agencyzoom](https://composio.dev/toolkits/agencyzoom) - AgencyZoom is a sales and performance platform built for P&C insurance agencies. It helps agents boost sales, retain clients, and analyze producer results in one place.
- [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 Salesforce MCP?

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

### Can I use Tool Router MCP with OpenAI Agents SDK?

Yes, you can. OpenAI Agents SDK 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 Salesforce tools.

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

Yes, absolutely. You can configure which Salesforce 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 Salesforce data and credentials are handled as safely as possible.

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