Delete Metadata
sf_delete_metadataPermanently deletes one or more Salesforce metadata components (e.g., CustomObjects, Fields, Flows) using the Metadata API, enabling removal of resources that could not be deleted before.
Instructions
Permanently deletes one or more metadata components of a given type via the Metadata API's deleteMetadata call — works for CustomObject, CustomField, Flow, GenAiFunction, GenAiPlugin, GenAiPlannerBundle, Bot, ApexClass, and most other metadata types. There was previously no way to remove anything created by this MCP server (sf_deploy_metadata only supports adding/updating components, not destructiveChanges) — diagnostic or abandoned metadata had nowhere to go. Deletes each fullName independently: check the response's deleted/errors lists rather than assuming all all-or-nothing. Some types have dependency order requirements (e.g. delete a Bot's GenAiFunction/GenAiPlugin/GenAiPlannerBundle before the Bot itself, delete CustomField before its parent CustomObject) — Salesforce will reject a delete that still has dependents, naming them in the error.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fullNames | Yes | Full names of the components to delete, e.g. ['My_Object__c'] or ['My_Object__c.My_Field__c']. Deletes each independently — some may succeed while others fail; check the response's deleted/errors lists rather than assuming all-or-nothing. | |
| metadataType | Yes | Metadata type to delete, e.g. 'CustomObject', 'CustomField', 'Flow', 'GenAiFunction', 'GenAiPlugin', 'GenAiPlannerBundle', 'Bot' |