<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Prajwal Joshi on Medium]]></title>
        <description><![CDATA[Stories by Prajwal Joshi on Medium]]></description>
        <link>https://medium.com/@ashujoshi614?source=rss-9e2bc562f863------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*LaS8oqERPC9LKmQGhf-ZIg.jpeg</url>
            <title>Stories by Prajwal Joshi on Medium</title>
            <link>https://medium.com/@ashujoshi614?source=rss-9e2bc562f863------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 23:02:28 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ashujoshi614/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Managing Salesforce Orgs with Natural Language Using MCP Server]]></title>
            <link>https://medium.com/@ashujoshi614/managing-salesforce-orgs-with-natural-language-using-mcp-server-175e6b2ae967?source=rss-9e2bc562f863------2</link>
            <guid isPermaLink="false">https://medium.com/p/175e6b2ae967</guid>
            <dc:creator><![CDATA[Prajwal Joshi]]></dc:creator>
            <pubDate>Tue, 22 Jul 2025 07:56:09 GMT</pubDate>
            <atom:updated>2025-07-22T07:56:09.766Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UEz-ruZDG-zYkzJdVlF8Vw.png" /></figure><p>In my <a href="https://medium.com/@ashujoshi614/using-google-adk-to-make-salesforce-listen-to-natural-language-690119f5f39d">last blog</a> I used Google-ADK to create a multi agent model which lets us interact with Salesforce using simple-salesforce, which is quite powerful in its own. Now, I want to show you how to implementing the same functionality with an MCP server not only simplifies the architecture but also makes it universally accessible across different AI environments.</p><p>And It also overcomes some limitations that we had using Google-ADK like:</p><ol><li><strong>Local Development &amp; Zero API Costs: </strong>Unlike the Google ADK approach that required cloud resources and API keys, MCP servers run entirely locally. You can develop, test, and use your Salesforce integration without any external dependencies or ongoing costs. This is particularly valuable for personal projects, learning, or organizations with strict data governance requirements.</li></ol><p><strong>2. Universal Tool Integration:</strong> The real power of MCP lies in its “USB for AI” philosophy. Once you’ve built your Salesforce MCP server, it becomes instantly available across multiple AI environments:</p><ul><li>VS Code Copilot for testing all your tools while creating them.</li><li>Claude Desktop for conversational Salesforce management</li><li>Any other MCP-compatible AI application</li></ul><p>With Google ADK, your agents were confined to the specific deployment environment you configured.</p><p><strong>3. Simplified Architecture &amp; Better Salesforce Integration: </strong>Google ADK’s multi-agent approach, while sophisticated, introduced complexity for straightforward CRUD operations. MCP’s tool-based interface is more intuitive for Salesforce interactions — each Salesforce operation becomes a well-defined tool that can be called naturally through conversation. Additionally, switching to jsforce from simple-salesforce was a relief.</p><h3>Implementing a MCP server</h3><p>Implementing a MCP server is fairly easy, first we will have to create a node project and add dependencies for MCP SDK and typescript using:</p><pre>npm install @modelcontextprotocol/sdk zod<br>npm install -D @types/node typescript</pre><p>After these are configured we can start building our MCP server.</p><h3>MCP Server Initialization</h3><p>We can instantiate our custom MCP server class, and it exposes your tools automatically to any MCP-compatible AI agent.</p><pre>import { Server } from &quot;@modelcontextprotocol/sdk/server/index.js&quot;;<br>import { StdioServerTransport } from &quot;@modelcontextprotocol/sdk/server/stdio.js&quot;;<br>import {<br>  CallToolRequestSchema,<br>  ErrorCode,<br>  ListToolsRequestSchema,<br>  McpError,<br>} from &quot;@modelcontextprotocol/sdk/types.js&quot;;<br>import jsforce, { Connection, SaveResult } from &quot;jsforce&quot;;<br><br>class SalesforceMCPServer {<br>  private server: Server;<br>  private connection: Connection;<br>   //Server tools and other logic<br>  }<br>  <br> const server = new SalesforceMCPServer();<br> server.run().catch(console.error);</pre><h3>Adding Salesforce Authentication:</h3><p>Unlike many boilerplate integrations that support a single org, this setup handles <strong>multiple Salesforce orgs</strong>. Here’s how we’re securely managing authentication:</p><pre>private async authenticate(): Promise&lt;void&gt; {<br>    if (!SF_USERNAME || !SF_PASSWORD) {<br>      throw new McpError(<br>        ErrorCode.InvalidRequest,<br>        &quot;Salesforce credentials not configured. Please set SF_USERNAME and SF_PASSWORD environment variables.&quot;<br>      );<br>    }<br><br>  try {<br>        await this.connection.login(<br>          SF_USERNAME,<br>          SF_PASSWORD + (SF_SECURITY_TOKEN || &quot;&quot;)<br>        );<br>      } catch (error) {<br>        throw new McpError(<br>          ErrorCode.InternalError,<br>          `Failed to authenticate with Salesforce: ${error}`<br>        );<br>      }<br>    }</pre><h3>Org Management Tools:</h3><p>Now we can provide the the org gets added, and all future tools can now run in that org’s context.</p><pre>private async addOrg(<br>  name: string,<br>  username: string,<br>  password: string,<br>  securityToken: string,<br>  loginUrl: string<br>): Promise&lt;string&gt; {<br>  const orgId = `org_${Date.now()}_${Math.random().toString(36).substr(2, 6)}`;<br>  const orgInfo: OrgInfo = { orgId, name, username, password, securityToken, loginUrl };<br>  this.orgs.set(orgId, orgInfo);<br>  if (!this.currentOrgId) this.currentOrgId = orgId;<br>  return orgId;<br>}</pre><p>After basic setup is done we can start adding tools in our server as per our needs.</p><h3>Creating MCP tools:</h3><p>In this implementation I wanted to extend the functionality in my Google-ADK implementation which was able to create Objects and Fields. So in this MCP implementation I want the MCP to design a salesforce object schema with multiple object and fields and implement it in salesforce.</p><p>Here is the implementation for it:</p><p><strong>1. Schema Design via Natural Language</strong></p><pre>private async handleDesignSchema(<br>  requirements: string,<br>  includeRelationships: boolean = true,<br>  complexity: string = &quot;medium&quot;<br>) {<br>  const schemaId = this.generateSchemaId();<br>  const schema = this.generateSchemaFromRequirements(requirements, includeRelationships, complexity);<br><br>  this.schemaStore.set(schemaId, {<br>    requirements,<br>    schema,<br>    createdAt: new Date(),<br>  });<br>  return {<br>    content: [<br>      {<br>        type: &quot;text&quot;,<br>        text: JSON.stringify({<br>          schemaId,<br>          requirements,<br>          schema,<br>          message: &quot;Schema designed successfully!&quot;,<br>        }, null, 2),<br>      },<br>    ],<br>  };<br>}</pre><p>This function takes natural language requirements and returns a structured schema definition ready to be implemented or updated.</p><ol><li><strong>Schema Deployment to Salesforce</strong></li></ol><pre>private async handleImplementSchema(<br>  schemaId: string,<br>  modifications?: any,<br>  dryRun: boolean = false<br>) {<br>  const schemaData = this.schemaStore.get(schemaId);<br>  if (!schemaData) throw new Error(&quot;Schema not found&quot;);<br>  const result = await this.deploySchemaToSalesforce(schemaData.schema, modifications, dryRun);<br>  return {<br>    content: [<br>      {<br>        type: &quot;text&quot;,<br>        text: JSON.stringify({<br>          schemaId,<br>          message: &quot;Schema implementation completed!&quot;,<br>          result<br>        }, null, 2),<br>      },<br>    ],<br>  };<br>}</pre><p>Under the hood, all deployments are driven by the Salesforce Metadata API via jsforce</p><pre>private async handleCreateCustomObject(args: any, conn?: Connection) {<br>    try {<br>      const connection = conn || this.connection;<br>      const metadata = {<br>        fullName: args.fullName,<br>        label: args.label,<br>        pluralLabel: args.pluralLabel,<br>        description: args.description || &quot;&quot;,<br>        deploymentStatus: args.deploymentStatus || &quot;Deployed&quot;,<br>        sharingModel: args.sharingModel || &quot;ReadOnly&quot;,<br>        nameField: {<br>          label: args.nameField?.label || &quot;Name&quot;,<br>          type: args.nameField?.type || &quot;Text&quot;,<br>          ...(args.nameField?.type === &quot;AutoNumber&quot; &amp;&amp; {<br>            displayFormat: args.nameField.displayFormat || &quot;AUTO-{0000}&quot;,<br>            startingNumber: args.nameField.startingNumber || 1,<br>          }),<br>        },<br>      };<br><br>      const result = await connection.metadata.create(&quot;CustomObject&quot;, metadata);<br>      <br>      return {<br>        content: [<br>          {<br>            type: &quot;text&quot;,<br>            text: JSON.stringify({<br>              success: result.success,<br>              fullName: result.fullName,<br>              errors: result.errors,<br>            }, null, 2),<br>          },<br>        ],<br>      };<br>    } catch (error) {<br>      throw new McpError(<br>        ErrorCode.InternalError,<br>        `Custom object creation failed: ${error}`<br>      );<br>    }<br>  }</pre><pre>private async handleCreateCustomField(args: any, conn?: Connection) {<br>    try {<br>      const connection = conn || this.connection;<br>      const metadata: any = {<br>        fullName: `${args.objectName}.${args.fullName}`,<br>        label: args.label,<br>        type: args.type,<br>        required: args.required || false,<br>        unique: args.unique || false,<br>        externalId: args.externalId || false,<br>      };<br><br>      // Add type-specific properties<br>      if (args.type === &quot;Text&quot; &amp;&amp; args.length) {<br>        metadata.length = args.length;<br>      }<br>      <br>      if (args.type === &quot;Number&quot; &amp;&amp; args.precision) {<br>        metadata.precision = args.precision;<br>        metadata.scale = args.scale || 0;<br>      }<br>      if (args.type === &quot;TextArea&quot;) {<br>        metadata.length = args.length || 255;<br>      }<br>      if (args.type === &quot;LongTextArea&quot;) {<br>        metadata.length = args.length || 32768;<br>        metadata.visibleLines = 3;<br>      }<br>      if ((args.type === &quot;Picklist&quot; || args.type === &quot;MultiselectPicklist&quot;) &amp;&amp; args.picklistValues) {<br>        metadata.valueSet = {<br>          valueSetDefinition: {<br>            sorted: false,<br>            value: args.picklistValues.map((pv: any) =&gt; ({<br>              fullName: pv.fullName,<br>              label: pv.label || pv.fullName,<br>              default: pv.default || false,<br>            })),<br>          },<br>        };<br>      }<br>      if ((args.type === &quot;Lookup&quot; || args.type === &quot;MasterDetail&quot;) &amp;&amp; args.referenceTo) {<br>        metadata.referenceTo = args.referenceTo;<br>        metadata.relationshipName = args.relationshipName || args.fullName.replace(&quot;__c&quot;, &quot;&quot;);<br>        <br>        if (args.type === &quot;MasterDetail&quot;) {<br>          metadata.required = true;<br>        }<br>      }<br>      const result = await connection.metadata.create(&quot;CustomField&quot;, metadata);<br>      <br>      return {<br>        content: [<br>          {<br>            type: &quot;text&quot;,<br>            text: JSON.stringify({<br>              success: result.success,<br>              fullName: result.fullName,<br>              errors: result.errors,<br>            }, null, 2),<br>          },<br>        ],<br>      };<br>    } catch (error) {<br>      throw new McpError(<br>        ErrorCode.InternalError,<br>        `Custom field creation failed: ${error}`<br>      );<br>    }<br>  }</pre><p>After our MCP server is implemented we can import it to Claude Desktop and interact with it using natural language.</p><p>To use your MCP in Claude Desktop you can go to <strong>Settings</strong> → <strong>Developer</strong> → <strong>Edit config</strong>.</p><p>And open <strong>claude_desktop_config</strong> file and add this in it.</p><pre>{<br>  &quot;mcpServers&quot;: {<br>    &quot;sf-mcp-server&quot;: {<br>      &quot;command&quot;: &quot;node&quot;,<br>      &quot;args&quot;: [&quot;path to your MCP file&quot;]<br>    }<br>  }<br>}</pre><p>After this we can start interacting with our MCP via Claude Desktop in natural language.</p><p><strong>Here is an example of implementing a Schema with just a prompt:</strong></p><p>Let’s say you’re building a new <strong>Event Management system</strong> in Salesforce. You want to track:</p><ul><li>Events (obviously)</li><li>Attendees</li><li>Speakers</li><li>Venues</li></ul><p>Now, normally this would involve:</p><ul><li>Multiple custom objects,</li><li>Dozens of fields,</li><li>Cross-object relationships…</li></ul><p>But what if you could just say:</p><blockquote><em>“Create an event management schema with objects for Event, Attendee, Speaker, and Venue. Events should have a date, location, and capacity. Attendees have name, email, and ticket type. Speakers should have bio and topic. Venue should have address and seating capacity. Each event is linked to a venue, and has many attendees and speakers.”</em></blockquote><p>So for doing this we can connect our salesforce org first by giving our credentials in a prompt and then MCP will authorize our org to be used by all the MCP tools.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wI85niotpO1d7v1pHEtlUA.png" /><figcaption>Adding Salesforce Org</figcaption></figure><p>Now we can give our prompt to implement the <strong>Event Management system</strong> and it will be done.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jz64e_dK1ZwhQe2c-GcWVg.gif" /></figure><p>And like this the whole <strong>Event Management system</strong> will be implemented.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pQDJ8h0AS51z5cmSoHgDJA.png" /></figure><p>We can also add tools in our MCP to create tabs for custom objects and even edit the page layouts the possibilities are endless.</p><p>You can checkout my <a href="https://github.com/AshuJoshi001/Salesforce-MCP-Server">GitHub repo</a> for some other tools that I have created.</p><p><em>Note: Some of them are not working.</em></p><h3>Final Thoughts</h3><p>Implementing an MCP (Multi-Agent Control Plane) server requires initial effort, but the long-term advantages far outweigh the setup time. Once in place, the server becomes a reusable, extensible asset that can integrate with multiple AI platforms and evolve simply by adding new tools as needed.</p><p>While we may not yet be ready to let an MCP directly modify our Salesforce production orgs, it proves to be an invaluable resource in sandbox environments. It streamlines experimentation, simplifies testing, and even allows us to generate custom dummy data tailored to specific testing scenarios.</p><p>In the future, we can build a process where Salesforce admins or developers review and approve the changes made by MCP. This way, we can safely use natural language to make updates, while keeping everything under control and easy to manage as the system grows.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=175e6b2ae967" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using Google ADK to Make Salesforce Listen to Natural Language]]></title>
            <link>https://medium.com/@ashujoshi614/using-google-adk-to-make-salesforce-listen-to-natural-language-690119f5f39d?source=rss-9e2bc562f863------2</link>
            <guid isPermaLink="false">https://medium.com/p/690119f5f39d</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[salesforce-development]]></category>
            <category><![CDATA[salesforce]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <dc:creator><![CDATA[Prajwal Joshi]]></dc:creator>
            <pubDate>Sun, 13 Apr 2025 11:40:14 GMT</pubDate>
            <atom:updated>2025-04-13T11:40:14.919Z</atom:updated>
            <content:encoded><![CDATA[<p>When Google recently launched its Agent Development Kit (ADK), in which we can create multi-agentic systems that is easy to implement and provides a web UI to interact with agents. As a Salesforce developer, I immediately started thinking: <em>what if I can create agents which are salesforce functions being executed by a root agent?</em></p><p>That led me to thinking about combining Google’s ADK, and the simple-salesforce library. The result? A working prototype where you can say something like</p><blockquote><em>“Create a new custom field Test_Agent on the Account object.”</em></blockquote><p>And the agent <em>just does it</em> — from authenticating with Salesforce to creating that field through metadata API calls provided by simple salesforce library.</p><p>In this post, I’ll walk you through the idea, how I built it, and where this kind of integration might be headed.</p><h3>Why ADK + Salesforce?</h3><p>Salesforce has a powerful API, but it’s not always accessible to non-technical users. Google’s ADK, on the other hand, is built for creating <em>multimodal, goal-oriented agents</em> that can plan, reason, and execute tasks in response to human language. It’s like giving your CRM a brain (and ears).</p><p>The ADK provides:</p><ul><li><strong>Multimodal input handling</strong> (voice, text, images)</li><li><strong>Tool use and reasoning</strong> via “abilities”</li><li><strong>Agent memory and context</strong></li><li><strong>Prompt templating and planning</strong></li></ul><p>Perfect for turning everyday Salesforce actions into conversational workflows.</p><h3>Technical Implementation:</h3><h3>Installing Google ADK:</h3><p>Google has made installing ADK very easy and has provided detailed steps from installing it to running it in its developer guide: <a href="https://cloud.google.com/vertex-ai/generative-ai/docs/agent-development-kit/quickstart#agent.py">https://cloud.google.com/vertex-ai/generative-ai/docs/agent-development-kit/quickstart#agent.py</a></p><p>So If you follow this guide properly you will have a agent running which tells you about weather. Great!</p><p>Now we can start configuring it to understand and handle salesforce requests.</p><p><strong>Installing Simple Salesforce:</strong></p><p>In the development environment in which our ADK is configured. We can install simple-salesforce library by:</p><pre>pip install simple-salesforce</pre><p><strong>Configuring Agents for salesforce:</strong></p><p>Currently in our ADK project the weather info is handled by 3 agents.</p><p><strong>get_weather:</strong> gets weather info</p><p><strong>get_current_time:</strong> gets current time of the location for which we want to get weather info</p><p><strong>weather_time_agent:</strong> root agent which uses the other two agents to get info and provide an output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/495/1*MDANXju79ASCzBOApwSegw.png" /><figcaption>Google ADK default weather agent</figcaption></figure><pre>from google.adk.agents import Agent<br><br>def get_weather(city: str) -&gt; dict:<br>    &quot;&quot;&quot;Retrieves the current weather report for a specified city.<br>    Returns:<br>        dict: A dictionary containing the weather information with a &#39;status&#39; key (&#39;success&#39; or &#39;error&#39;) and a &#39;report&#39; key with the weather details if successful, or an &#39;error_message&#39; if an error occurred.<br>    &quot;&quot;&quot;<br>    if city.lower() == &quot;new york&quot;:<br>        return {&quot;status&quot;: &quot;success&quot;,<br>                &quot;report&quot;: &quot;The weather in New York is sunny with a temperature of 25 degrees Celsius (41 degrees Fahrenheit).&quot;}<br>    else:<br>        return {&quot;status&quot;: &quot;error&quot;,<br>                &quot;error_message&quot;: f&quot;Weather information for &#39;{city}&#39; is not available.&quot;}<br>def get_current_time(city:str) -&gt; dict:<br>    &quot;&quot;&quot;Returns the current time in a specified city.<br>    Args:<br>        dict: A dictionary containing the current time for a specified city information with a &#39;status&#39; key (&#39;success&#39; or &#39;error&#39;) and a &#39;report&#39; key with the current time details in a city if successful, or an &#39;error_message&#39; if an error occurred.<br>    &quot;&quot;&quot;<br>    import datetime<br>    from zoneinfo import ZoneInfo<br>    if city.lower() == &quot;new york&quot;:<br>        tz_identifier = &quot;America/New_York&quot;<br>    else:<br>        return {&quot;status&quot;: &quot;error&quot;,<br>                &quot;error_message&quot;: f&quot;Sorry, I don&#39;t have timezone information for {city}.&quot;}<br>    tz = ZoneInfo(tz_identifier)<br>    now = datetime.datetime.now(tz)<br>    return {&quot;status&quot;: &quot;success&quot;,<br>            &quot;report&quot;: f&quot;&quot;&quot;The current time in {city} is {now.strftime(&quot;%Y-%m-%d %H:%M:%S %Z%z&quot;)}&quot;&quot;&quot;}<br>root_agent = Agent(<br>    name=&quot;weather_time_agent&quot;,<br>    model=&quot;gemini-2.0-flash&quot;,<br>    description=&quot;Agent to answer questions about the time and weather in a city.&quot;,<br>    instruction=&quot;I can answer your questions about the time and weather in a city.&quot;,<br>    tools=[get_weather, get_current_time]<br>)</pre><p>So for our implementation we will also have to create similar agents</p><ol><li><strong>authenticate_salesforce:</strong> This agent will ask user for its salesforce credentials and authenticate salesforce with simple salesforce auth. We can also skip this by directly putting our salesforce creds in .env file. But then it will only for that salesforce org.</li><li><strong>create_custom_field:</strong> This agent will take input from user that what will Name of field, in which object this fields has to be created and type of field.</li><li><strong>update_page_layout:</strong> This agent will then add that field to that objects page layout. We can also skip this step if we want</li><li><strong>salesforce_AI_assistant:</strong> This will be our root agent which will user the other agents to get the job done.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/572/1*l1nUBZIEfvdjYq0LyA6T6Q.png" /><figcaption>Saleforce Agents</figcaption></figure><pre>from google.adk.agents import Agent<br>from simple_salesforce import Salesforce<br>import json<br>from typing import Optional<br><br># We&#39;ll use a simple session storage approach<br>sf_connection = None<br>def authenticate_salesforce(username: str, password: str, security_token: str) -&gt; dict:<br>    &quot;&quot;&quot;Authenticates with Salesforce using provided credentials.<br>    <br>    Args:<br>        username: Salesforce username<br>        password: Salesforce password<br>        security_token: Security token for the Salesforce account<br>        <br>    Returns:<br>        dict: Success or error status with connection information<br>    &quot;&quot;&quot;<br>    global sf_connection<br>    try:<br>        sf_connection = Salesforce(username=username, password=password, security_token=security_token)<br>        return {<br>            &quot;status&quot;: &quot;success&quot;,<br>            &quot;message&quot;: f&quot;Successfully connected to Salesforce as {username}&quot;<br>        }<br>    except Exception as e:<br>        return {<br>            &quot;status&quot;: &quot;error&quot;,<br>            &quot;error_message&quot;: f&quot;Authentication failed: {str(e)}&quot;<br>        }<br>def create_custom_field(object_name: str, field_name: str, field_type: str, label: Optional[str] = None) -&gt; dict:<br>    &quot;&quot;&quot;Creates a new custom field on a Salesforce object.<br>    <br>    Args:<br>        object_name: API name of the Salesforce object<br>        field_name: API name for the new field (without __c)<br>        field_type: Salesforce field type (Text, Number, etc.)<br>        label: Display label for the field (defaults to field_name if not provided)<br>        <br>    Returns:<br>        dict: Success or error status with field creation information<br>    &quot;&quot;&quot;<br>    global sf_connection<br>    <br>    if not sf_connection:<br>        return {<br>            &quot;status&quot;: &quot;error&quot;,<br>            &quot;error_message&quot;: &quot;Not authenticated to Salesforce. Please authenticate first.&quot;<br>        }<br>    <br>    try:<br>        if not label:<br>            label = field_name.replace(&#39;_&#39;, &#39; &#39;).title()<br>            <br>        # Field type mapping<br>        field_type_map = {<br>            &quot;text&quot;: &quot;Text&quot;,<br>            &quot;number&quot;: &quot;Number&quot;,<br>            &quot;checkbox&quot;: &quot;Checkbox&quot;,<br>            &quot;date&quot;: &quot;Date&quot;,<br>            &quot;datetime&quot;: &quot;DateTime&quot;,<br>            &quot;email&quot;: &quot;Email&quot;,<br>            &quot;phone&quot;: &quot;Phone&quot;,<br>            &quot;picklist&quot;: &quot;Picklist&quot;,<br>            &quot;url&quot;: &quot;Url&quot;,<br>            &quot;currency&quot;: &quot;Currency&quot;,<br>            &quot;textarea&quot;: &quot;TextArea&quot;,<br>            &quot;longtextarea&quot;: &quot;LongTextArea&quot;<br>        }<br>        <br>        sf_field_type = field_type_map.get(field_type.lower(), field_type)<br>        <br>        # Get the metadata API object<br>        mdapi = sf_connection.mdapi<br>        <br>        # Create the custom field metadata definition with explicit type<br>        # Use CustomField class to ensure proper typing<br>        custom_field = mdapi.CustomField(<br>            fullName=f&#39;{object_name}.{field_name}__c&#39;,<br>            label=label,<br>            type=mdapi.FieldType(sf_field_type)<br>        )<br>        <br>        # Add field-specific properties<br>        if sf_field_type == &#39;Text&#39;:<br>            custom_field.length = 255<br>        elif sf_field_type == &#39;Number&#39;:<br>            custom_field.precision = 18<br>            custom_field.scale = 0<br>        <br>        # Create the metadata in Salesforce<br>        try:<br>            mdapi.CustomField.create(custom_field)<br>            return {<br>                &quot;status&quot;: &quot;success&quot;,<br>                &quot;message&quot;: f&quot;Custom field {field_name}__c created on {object_name}&quot;,<br>                &quot;field_details&quot;: f&quot;Field Type: {sf_field_type}, Label: {label}&quot;<br>            }<br>        except Exception as api_error:<br>            return {<br>                &quot;status&quot;: &quot;error&quot;,<br>                &quot;error_message&quot;: f&quot;Field creation failed: {str(api_error)}&quot;<br>            }<br>            <br>    except Exception as e:<br>        return {<br>            &quot;status&quot;: &quot;error&quot;,<br>            &quot;error_message&quot;: f&quot;Field creation failed: {str(e)}&quot;<br>        }<br>def update_page_layout(object_name: str, layout_name: str, field_names: str) -&gt; dict:<br>    &quot;&quot;&quot;Adds fields to a Salesforce page layout.<br>    <br>    Args:<br>        object_name: API name of the Salesforce object<br>        layout_name: Name of the page layout to update<br>        field_names: Comma-separated list of field API names to add to the layout<br>        <br>    Returns:<br>        dict: Success or error status with layout update information<br>    &quot;&quot;&quot;<br>    global sf_connection<br>    <br>    if not sf_connection:<br>        return {<br>            &quot;status&quot;: &quot;error&quot;,<br>            &quot;error_message&quot;: &quot;Not authenticated to Salesforce. Please authenticate first.&quot;<br>        }<br>    <br>    try:<br>        field_list = [f.strip() for f in field_names.split(&#39;,&#39;)]<br>        # Metadata request not implement yet!<br>        return {<br>            &quot;status&quot;: &quot;success&quot;,<br>            &quot;message&quot;: f&quot;Updated layout {layout_name} for {object_name} with fields: {field_names}&quot;<br>        }<br>    except Exception as e:<br>        return {<br>            &quot;status&quot;: &quot;error&quot;, <br>            &quot;error_message&quot;: f&quot;Layout update failed: {str(e)}&quot;<br>        }<br>root_agent = Agent(<br>    name=&quot;salesforce_AI_assistant&quot;,<br>    model=&quot;gemini-2.0-flash&quot;,<br>    description=&quot;Agent that helps Salesforce developers manage Salesforce metadata using natural language commands&quot;,<br>    instruction=&quot;&quot;&quot;<br>    I can help you manage Salesforce metadata using natural language commands. <br>    Tell me what you want to change in your Salesforce org, and I&#39;ll help you implement it.<br>    I can create/update custom objects, fields, page layouts, and more.<br>    First, I&#39;ll need you to authenticate with your Salesforce credentials.<br>    &quot;&quot;&quot;,<br>    tools=[<br>        authenticate_salesforce,<br>        create_custom_field,<br>        update_page_layout,<br>        <br>    ]<br>)</pre><p>We can also add more agents which can handle object creation, record creation, query data and much more.</p><p><strong>Running agent on web:</strong></p><p>After agent is configured for salesforce we can just run:</p><pre>adk web</pre><p>And an web UI will be created in which we can interact with our agent.</p><p><strong>Prototype Example:</strong> Here is an conversation with this agent to connect with my salesforce org and create a custom field.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cSUSePGHpPgJthszI5mtwQ.png" /><figcaption>ADK Converstion UI</figcaption></figure><p>And it created a custom field as instructed:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vjjpmFUMOHExPNuMMtMXHw.png" /><figcaption>Created Field</figcaption></figure><h3>Possibilities:</h3><p>What’s exciting about this approach is how <strong>modular and expandable</strong> it is.</p><p>You could build on this foundation to create a full <strong>natural-language interface for Salesforce Admins</strong>, enabling them to:</p><ul><li>Create or delete custom objects</li><li>Manage record types and picklist values</li><li>Deploy metadata between sandboxes</li><li>Even trigger Apex executions or start batch jobs</li></ul><p>Imagine someone saying:</p><blockquote><em>“Add a picklist field called Customer_Type to the Contact object with values: Prospect, Client, Partner.”</em></blockquote><p>…and the agent just handles it.</p><p>Or we can make it implement a solution which contains multiple objects and fields.</p><p>We can even create a agent which suggests an saleforce implementation and implement it.</p><p>No clicks. No setup. No field-level confusion. Just intent → execution.</p><h3>Final Thoughts:</h3><p>Combining the power of <strong>Google’s Agent Development Kit</strong> with the flexibility of <strong>Salesforce APIs</strong> via simple-salesforce opens up a new world of possibilities.</p><p>This isn’t just a technical proof of concept — it’s a signal of where the future of enterprise tooling is headed.</p><p>If you’re a Salesforce developer or admin, now’s the time to explore how agents can <em>work with you</em>, not just for you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=690119f5f39d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>