Recommended
Building a custom Apex tool for Lead conversion with Salesforce Model Context Protocol (opens in a new tab)
You will learn how to configure a Salesforce Model Context Protocol server and write an Invocable Apex class to handle Lead conversion through AI agents.
Why read this
The piece clarifies why generic record mutation tools cannot replace the native conversion process.
Introduces Salesforce Headless 360 and the Model Context Protocol as methods for AI agents to interact with orgs. Explains that basic access is free but may consume Flex Credits.
Walks through creating a custom MCP server in Setup and notes that default tools do not support Lead conversion. Details the architectural reason why generic SObject mutation tools fail for this task, citing atomic execution, field mapping, deduplication, and related record reparenting.
Outlines the requirement to build an Invocable Apex class using Database.convertLead(). Describes the necessary annotations and access modifiers needed to expose the method to the MCP framework.
Read the original at Salesforce Break (opens in a new tab)