> This page is for Agent Handler.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.merge.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.merge.dev/_mcp/server.

# Salesforce

**Authentication:** OAuth or username/password + security token. See [Magic Link](/merge-agent-handler/features/magic-link) for the runtime auth flow, or [Application credentials](/merge-agent-handler/admin-setup/add-oauth-credentials) to bring your own OAuth app.

## Sample use cases

* List Salesforce opportunities in `Negotiation` with no activity in the last 14 days, grouped by owner.
* Update the close date on every open opportunity past its expected close to next quarter.
* Find accounts in the `Enterprise` segment that haven't had a meeting logged in 30 days.

## Available Tools

#### create\_account

Create a new Salesforce account. Required: Name (must be unique). Use unique account names with timestamps to avoid duplicates.

#### get\_account

Retrieve a Salesforce account by ID with complete details including standard and custom fields.

#### update\_account

Update an existing Salesforce account with new information.

#### delete\_account

Permanently delete a Salesforce account from the system.

#### list\_accounts

List Salesforce accounts with automatic field access handling. Dynamically removes inaccessible fields and retries query.

#### search\_accounts

Search Salesforce accounts using text queries across name, website, and phone fields.

#### create\_event

Create a new Salesforce event. Required workflow: Call discover\_required\_fields('Event') first to identify mandatory fields and prevent creation errors.

#### get\_event

Get a Salesforce event by ID

#### update\_event

Update an existing Salesforce event

#### delete\_event

Delete a Salesforce event

#### list\_events

List Salesforce events

#### log\_activity

Log a Salesforce activity

#### search\_events

Search Salesforce events

#### create\_case

Create a new Salesforce case. Required workflow: Call discover\_required\_fields('Case') first to identify mandatory fields and prevent creation errors.

#### get\_case

Retrieve a Salesforce case by ID with complete details including standard and custom fields.

#### update\_case

Update an existing Salesforce case with new information.

#### delete\_case

Permanently delete a Salesforce case from the system.

#### list\_cases

List Salesforce cases with automatic field access handling. Dynamically removes inaccessible fields and retries query. Supports flexible filtering with comparison operators.

#### search\_cases

Search Salesforce cases using text queries across subject and description fields.

#### get\_chatter\_comments

Get comments for a Chatter feed element.

#### post\_chatter\_comment

Post comment to Chatter feed element.

#### update\_chatter\_comment

Update Chatter comment by ID.

#### delete\_chatter\_comment

Delete Chatter comment by ID.

#### get\_chatter\_comment

Get specific Chatter comment by ID.

#### get\_chatter\_feed

Get Chatter feed for news, user, group, or record.

#### post\_to\_chatter\_feed

Post to Chatter feed (news, user, group, or record).

#### get\_chatter\_feed\_element

Get specific Chatter feed element by ID.

#### delete\_chatter\_feed\_element

Delete Chatter feed element by ID.

#### list\_chatter\_groups

List Chatter groups.

#### create\_chatter\_group

Create new Chatter group.

#### get\_chatter\_group

Get specific Chatter group by ID.

#### join\_chatter\_group

Join Chatter group.

#### leave\_chatter\_group

Leave Chatter group.

#### get\_chatter\_group\_members

Get Chatter group members.

#### get\_chatter\_user

Get Chatter user information by ID.

#### follow\_chatter\_user

Follow Chatter user.

#### unfollow\_chatter\_user

Unfollow Chatter user.

#### get\_chatter\_user\_followers

Get Chatter user followers.

#### get\_chatter\_user\_following

Get Chatter users being followed.

#### like\_chatter\_item

Like Chatter item (feed element or comment).

#### unlike\_chatter\_item

Unlike Chatter item (feed element or comment).

#### create\_contact

Create a new Salesforce contact. Required workflow: Call discover\_required\_fields('Contact') first to identify mandatory fields and prevent creation errors.

#### get\_contact

Retrieve a Salesforce contact by ID with complete details including standard and custom fields.

#### update\_contact

Update an existing Salesforce contact with new information.

#### delete\_contact

Permanently delete a Salesforce contact from the system.

#### list\_contacts

List Salesforce contacts with automatic field access handling. Dynamically removes inaccessible fields and retries query. Supports flexible filtering with comparison operators.

#### search\_contacts

Search Salesforce contacts using text queries across name, email, and phone fields.

#### list\_objects

List all standard and custom objects in the Salesforce org.

#### discover\_required\_fields

Discover required, custom, and recommended fields for any Salesforce object.

#### discover\_properties

Discover all available properties/fields for Salesforce objects including custom fields, data types, picklist values, and field capabilities.

#### discover\_required\_fields\_for\_writes

Discover the minimal set of required fields for Salesforce write operations. Returns only non-nullable, createable fields without defaults. Use this before any create\_\* operation. Supports standard and custom objects.

#### run\_soql\_query

Execute a raw SOQL query against the Salesforce org. Use for ad-hoc queries, cross-object joins, aggregations, or any query not covered by entity-specific tools. Only SELECT queries are supported. Supports pagination via next\_records\_url.

#### create\_lead

Create a new Salesforce lead. Required: LastName, Company. Use unique email addresses and company names to avoid duplicate detection issues.

#### get\_lead

Retrieve a Salesforce lead by ID with complete details including standard and custom fields.

#### update\_lead

Update an existing Salesforce lead with new information.

#### delete\_lead

Permanently delete a Salesforce lead from the system.

#### list\_leads

List Salesforce leads with automatic field access handling. Dynamically removes inaccessible fields and retries query. Supports flexible filtering with comparison operators.

#### search\_leads

Search Salesforce leads using text queries across name, company, email, and phone fields.

#### convert\_lead

Convert a Salesforce lead to Account, Contact, and optionally Opportunity. IMPORTANT: Works best with newly created leads to avoid duplicate detection issues. Use unique account/contact names.

#### create\_note

Create a new Salesforce note. Required workflow: Call discover\_required\_fields('Note') first to identify mandatory fields and prevent creation errors.

#### get\_note

Get a Salesforce note by ID

#### update\_note

Update a Salesforce note

#### list\_notes

List Salesforce notes (both legacy Notes and modern ContentNotes)

#### search\_notes

Search Salesforce notes (both legacy Notes and modern ContentNotes)

#### delete\_note

Delete a Salesforce note

#### create\_opportunity

Create a new Salesforce opportunity. Required: Name, AccountId, StageName, CloseDate. Use valid AccountId and standard stage names for success.

#### get\_opportunity

Retrieve a Salesforce opportunity by ID with complete details including standard and custom fields.

#### delete\_opportunity

Permanently delete a Salesforce opportunity from the system.

#### update\_opportunity

Update an existing Salesforce opportunity with new information.

#### list\_opportunities

List Salesforce opportunities with automatic field access handling. Dynamically removes inaccessible fields and retries query. Supports flexible filtering with comparison operators.

#### search\_opportunities

Search Salesforce opportunities with automatic field access handling. Supports text search combined with flexible filtering. Dynamically removes inaccessible fields and retries query.

#### create\_task

Create a new Salesforce task. Required workflow: Call discover\_required\_fields('Task') first to identify mandatory fields and prevent creation errors.

#### get\_task

Retrieve a Salesforce task by ID with complete details including standard and custom fields.

#### update\_task

Update an existing Salesforce task with new information.

#### delete\_task

Permanently delete a Salesforce task from the system.

#### list\_tasks

List Salesforce tasks with automatic field access handling. Dynamically removes inaccessible fields and retries query. Supports flexible filtering with comparison operators.

#### search\_tasks

Search Salesforce tasks using text queries across subject and description fields.