SObject Deletes

The platform/sobject-deletes server provides targeted access for agents that need to remove records from Salesforce. It combines delete operations with schema discovery and query tools — giving agents the ability to identify records and delete them — while excluding create and update. This is a narrowly scoped server for deletion-specific workflows.

This server is appropriate for data hygiene use cases: deduplication cleanup, archival workflows, removing records that don't meet data quality standards, or bulk purging of records created in error. Because deletion is the highest-risk mutation, this server should be deployed with extra care — require human review before invoking delete tools wherever possible.

Deleted records go to the Recycle Bin and can be recovered in the Salesforce UI. No undelete tool is available through MCP at this time. Deletion is constrained by the authenticated user's object permissions — an agent cannot delete a record the user cannot delete manually.

For workflows that need the full range of mutations including deletion, use SObject All.

  • Production: https://api.salesforce.com/platform/mcp/v1/platform/sobject-deletes
  • Sandbox/Scratch: https://api.salesforce.com/platform/mcp/v1/sandbox/platform/sobject-deletes
  • "Find all duplicate lead records with the same email address and delete the older copies."
  • "Delete the test accounts created in the last 24 hours — they all have '[TEST]' in the name."
  • "Remove every Contact record that has no associated Account and has never had any activity."
  • "I have a list of opportunity IDs for closed-lost deals from 2020. Delete them from the system."
  • "Show me all Cases with status 'Invalid' before I approve deletion."

The sobject-deletes server provides the following tools.

Returns Salesforce schema information optimized for LLM consumption. Call with no parameters to get a compact index of all objects, then call with a specific object name to understand what fields are available when constructing queries to identify records for deletion — for example, finding the field that stores deduplication keys or record creation timestamps.

Two modes:

  • Index mode (no parameters): Compact list of all business objects with descriptions and relationships
  • Detail mode (with object name): Full field schema plus any contextual admin guidance

Inputs:

ParameterTypeRequiredDescription
object-namestringNoAPI name of the object. Omit to get the compact index of all objects.

Outputs: Index mode: compact list of queryable objects with descriptions. Detail mode: full field schema with types, required flags, picklist values, relationships, and any admin-authored guidance.

Executes a SOQL query to retrieve records for review before deletion. Always query and confirm the target record set before invoking a delete — present results to the user for approval when possible. Supports complex filtering to precisely identify records meeting deletion criteria.

Example: SELECT Id, Name, CreatedDate FROM Lead WHERE Email = 'duplicate@example.com' ORDER BY CreatedDate ASC LIMIT 100

Inputs:

ParameterTypeRequiredDescription
querystringYesA valid SOQL query string

Outputs: Array of matching records with the fields specified in the SELECT clause.

Executes a text search across multiple Salesforce objects. Use this to surface candidate records for deletion when the identifiers span multiple object types, or when searching by name or keyword rather than ID.

Example: FIND {[TEST]} IN NAME FIELDS RETURNING Account(Id, Name, CreatedDate), Contact(Id, Name, CreatedDate)

Inputs:

ParameterTypeRequiredDescription
searchstringYesA valid SOSL search string

Outputs: Search result groups by object type, each containing matched records with the requested fields.

Permanently deletes a record by ID. Confirm with the user before deleting. Deleted records go to the Recycle Bin and can be recovered in the Salesforce UI for up to 15 days — no undelete tool is available through MCP. Fails if the user lacks delete permission or deletion would violate relationship rules (e.g., deleting a parent with required child relationships).

Inputs:

ParameterTypeRequiredDescription
sobject-namestringYesAPI name of the object
idstringYesSalesforce record ID of the record to delete

Outputs: Success or error indicator.

Deletes a child record by navigating from a parent record through a relationship. Use this when you have the parent context and need to remove a specific related record. Same cautions as deleteSobjectRecord — confirm with the user before deleting.

Inputs:

ParameterTypeRequiredDescription
sobject-namestringYesAPI name of the parent object
idstringYesSalesforce record ID of the parent record
relationship-pathstringYesRelationship path to the record to delete

Outputs: Success or error indicator.