> This page is for Workforce.

> 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.