An example Salesforce agent built with IBM watsonx Orchestrate ADK that provides powerful tools to interact with your Salesforce org using the simple-salesforce Python library.
NOTE: This is just a example implementation to help you get started with orchestrate adk and create agents/tools/connections. The salesforce tools added here are NOT meant for deployment purpose. Please take this only as example implementation
- Python 3.8+
- IBM watsonx Orchestrate ADK
- Salesforce account with API access
git clone https://github.com/IBM/orchestrate-adk-agent.git
cd orchestrate-adk-agent
pip install -r requirements.txt
cp .env.template .env
# Fill in your Salesforce credentials in .envNote: Make scripts executable if needed:
chmod +x import_agent.sh setup_connection.sh check_connection.sh test_agent.sh
agents/: Agent configuration filestools/: Python tools for Salesforce operationsconnections/: Connection configuration filesrequirements.txt: Python dependencies.env.template: Environment variable templateimport_agent.sh,import_tools.sh,setup_connection.sh,check_connection.sh,test_agent.sh: Shell scripts for quick setup and testing
import_agent.sh: Imports the agent into Orchestrate../import_agent.sh
import_tools.sh: Imports the tools into Orchestrate../import_tools.sh
setup_connection.sh: Sets up Salesforce connection../setup_connection.sh
check_connection.sh: Checks connection status../check_connection.sh
test_agent.sh: Runs agent tests../test_agent.sh
Each script prints helpful messages and checks for required environment variables. If you encounter errors, ensure your .env file is configured and the scripts have execute permissions.
This project includes integration with MCP (Model Context Protocol) servers to extend the agent's capabilities. The Tavily MCP server provides AI-powered web search and research capabilities.
Documentation: For more information on MCP toolkits, see the IBM WatsonX Orchestrate Toolkits Documentation
- Node.js installed (for
npxcommand) - Tavily API key (included in the setup script or provide your own)
toolkits/tavily_mcp.yaml: MCP toolkit configuration fileimport_mcp_toolkit.sh: Import MCP toolkit via CLI commandimport_mcp_from_file.sh: Import MCP toolkit from YAML fileremove_mcp_toolkit.sh: Remove MCP toolkit
- Import the MCP toolkit:
./import_mcp_toolkit.shThis script will:
- Create a
tavily_credsconnection for the API key - Configure the connection for draft environment
- Import the Tavily MCP toolkit with all available tools
- Alternative: Import from YAML file:
./import_mcp_from_file.shOnce imported, the following tools are available:
| Tool | Description |
|---|---|
tavily_mcp_server:tavily-search |
AI-powered web search for finding information online |
tavily_mcp_server:tavily-extract |
Extract content from specific URLs |
tavily_mcp_server:tavily-crawl |
Crawl websites to gather comprehensive information |
tavily_mcp_server:tavily-map |
Map website structure and discover pages |
The Salesforce agent is configured to use Tavily tools for:
- Researching companies, competitors, or industry trends
- Enriching Salesforce lead/contact data with external information
- Finding current news about accounts or prospects
- Discovering company websites, social profiles, or contact information
- Verifying or supplementing Salesforce data with web sources
"Research the company Acme Corp and find their latest news"
"Find the LinkedIn profile for John Doe at IBM"
"What are the latest industry trends in cloud computing?"
"Extract contact information from https://example.com/about"
You can also import an MCP toolkit manually using the CLI:
# Setup connection first
orchestrate connections add -a tavily_creds
orchestrate connections configure -a tavily_creds --env draft --type team --kind key_value
orchestrate connections set-credentials -a tavily_creds --env draft -e "TAVILY_API_KEY=your_api_key"
# Import the toolkit
orchestrate toolkits add \
--kind mcp \
--name tavily_mcp_server \
--description "Tavily MCP Server for AI-powered web search" \
--command '["npx", "-y", "tavily-mcp@latest"]' \
--tools "*" \
--app-id tavily_credsTo remove the Tavily MCP toolkit:
./remove_mcp_toolkit.shTo see all imported toolkits:
orchestrate toolkits listThe Atlassian MCP server provides comprehensive Jira integration for issue tracking, project management, and agile workflows.
- uv installed (for
uvxcommand) - Jira Personal Access Token
toolkits/atlassian_mcp.yaml: MCP toolkit configuration fileimport_atlassian_mcp.sh: Import Atlassian MCP toolkit via CLI commandimport_atlassian_mcp_from_file.sh: Import Atlassian MCP toolkit from YAML fileremove_atlassian_mcp.sh: Remove Atlassian MCP toolkit
- Import the Atlassian MCP toolkit:
./import_atlassian_mcp.shYou will be prompted to enter:
- Your Jira username (email)
- Your Jira Personal Access Token
The Jira URL (https://jsw.ibm.com) is pre-configured in the script.
- Alternative: Import from YAML file:
./import_atlassian_mcp_from_file.shOnce imported, the following tools are available:
| Tool | Description |
|---|---|
atlassian_mcp_server:jira_get_issue |
Get details of a specific Jira issue |
atlassian_mcp_server:jira_search |
Search Jira issues using JQL |
atlassian_mcp_server:jira_create_issue |
Create a new Jira issue |
atlassian_mcp_server:jira_update_issue |
Update an existing Jira issue |
atlassian_mcp_server:jira_delete_issue |
Delete a Jira issue |
atlassian_mcp_server:jira_batch_create_issues |
Create multiple issues in batch |
| Tool | Description |
|---|---|
atlassian_mcp_server:jira_transition_issue |
Transition issue to a new status |
atlassian_mcp_server:jira_get_transitions |
Get available status transitions |
| Tool | Description |
|---|---|
atlassian_mcp_server:jira_add_comment |
Add a comment to an issue |
atlassian_mcp_server:jira_add_worklog |
Add a worklog entry |
atlassian_mcp_server:jira_get_worklog |
Get worklog entries for an issue |
| Tool | Description |
|---|---|
atlassian_mcp_server:jira_get_all_projects |
Get all accessible Jira projects |
atlassian_mcp_server:jira_get_project_issues |
Get all issues for a project |
atlassian_mcp_server:jira_get_project_versions |
Get all fix versions for a project |
atlassian_mcp_server:jira_create_version |
Create a new fix version |
atlassian_mcp_server:jira_batch_create_versions |
Batch create multiple versions |
| Tool | Description |
|---|---|
atlassian_mcp_server:jira_get_agile_boards |
Get agile boards by name, project, or type |
atlassian_mcp_server:jira_get_board_issues |
Get issues linked to a board |
atlassian_mcp_server:jira_get_sprints_from_board |
Get sprints from a board |
atlassian_mcp_server:jira_get_sprint_issues |
Get issues from a sprint |
atlassian_mcp_server:jira_create_sprint |
Create a new sprint |
atlassian_mcp_server:jira_update_sprint |
Update a sprint |
| Tool | Description |
|---|---|
atlassian_mcp_server:jira_create_issue_link |
Create a link between two issues |
atlassian_mcp_server:jira_remove_issue_link |
Remove a link between issues |
atlassian_mcp_server:jira_create_remote_issue_link |
Create a remote/web link |
atlassian_mcp_server:jira_get_link_types |
Get available link types |
atlassian_mcp_server:jira_link_to_epic |
Link an issue to an epic |
| Tool | Description |
|---|---|
atlassian_mcp_server:jira_get_user_profile |
Get user profile information |
atlassian_mcp_server:jira_download_attachments |
Download attachments from an issue |
atlassian_mcp_server:jira_search_fields |
Search Jira fields by keyword |
atlassian_mcp_server:jira_batch_get_changelogs |
Get changelogs for multiple issues |
The Salesforce agent is configured to use Atlassian Jira tools for:
- Querying and searching Jira issues
- Creating, updating, and deleting tickets
- Managing sprints and agile boards
- Tracking project progress
- Linking CRM data (Salesforce) with issue tracking (Jira)
- Adding comments and worklogs
- Managing project versions
"Get details of Jira issue PROJ-123"
"Search for all open bugs in project MYPROJ"
"Create a new bug in project MYPROJ with title 'Login issue'"
"Add a comment to issue PROJ-456"
"Show me all sprints for board 123"
"Transition issue PROJ-789 to 'In Progress'"
"Get all projects I have access to"
"Link issue PROJ-100 to epic PROJ-50"
You can also import the Atlassian MCP toolkit manually using the CLI:
# Setup connection first
orchestrate connections add -a atlassian_creds
orchestrate connections configure -a atlassian_creds --env draft --type team --kind key_value
orchestrate connections set-credentials -a atlassian_creds --env draft \
-e "JIRA_USERNAME=your_email@example.com" \
-e "JIRA_PERSONAL_TOKEN=your_token"
# Import the toolkit
orchestrate toolkits add \
--kind mcp \
--name atlassian_mcp_server \
--description "Atlassian MCP Server for Jira integration" \
--command '["uvx", "mcp-atlassian", "--jira-url=https://jsw.ibm.com", "--jira-username=${JIRA_USERNAME}", "--jira-personal-token=${JIRA_PERSONAL_TOKEN}"]' \
--tools "*" \
--app-id atlassian_credsTo remove the Atlassian MCP toolkit:
./remove_atlassian_mcp.sh- SOQL Queries: Execute complex Salesforce Object Query Language queries
- SOSL Searches: Search across multiple Salesforce objects
- CRUD Operations: Create, Read, Update, Delete records
- Bulk Operations: Handle multiple records efficiently
- Metadata Access: Describe objects, fields, and org structure
- User Information: Get current user and org details
- Query records with filtering, sorting, and relationships
- Search across multiple objects simultaneously
- Create new records with validation
- Update existing records with change tracking
- Delete records with confirmation
- Upsert records using external IDs
- Bulk create multiple records
- Get record counts with filtering
- Retrieve recent records
- Access object metadata and field definitions
- Clone or create the agent directory structure:
salesforce_agent/
├── agents/
│ └── salesforce_agent.yaml
├── tools/
│ └── salesforce_tools.py
├── connections/
│ └── salesforce_connection.yaml
├── requirements.txt
├── .env.template
├── import_agent.sh
├── setup_connection.sh
├── check_connection.sh
└── README.md- Install dependencies:
pip install -r requirements.txt- Configure credentials (choose one method):
Use the built-in script to set up the connection:
./setup_connection.shThis will:
- Import the connection configuration
- Prompt you for your Salesforce credentials
- Store them securely in orchestrate
- Associate the connection with your tools
Copy .env.template to .env and configure:
# For production org
SF_USERNAME=your_username@company.com
SF_PASSWORD=your_password
SF_SECURITY_TOKEN=your_security_token
SF_DOMAIN=login
# For sandbox org
SF_USERNAME=your_username@company.com.sandbox
SF_PASSWORD=your_password
SF_SECURITY_TOKEN=your_security_token
SF_DOMAIN=test- Import the agent:
./import_agent.sh- Import the tools:
./import_tools.sh- Set up your Salesforce connection:
./setup_connection.sh- Check connection status:
./check_connection.sh- Test the agent:
./test_agent.shThe agent uses orchestrate's connection management system to securely store and access credentials:
- Connection ID:
salesforce_creds - Connection Type:
key_value - Required Keys:
SF_USERNAME: Your Salesforce usernameSF_PASSWORD: Your Salesforce passwordSF_SECURITY_TOKEN: Your security tokenSF_DOMAIN:loginfor production,testfor sandbox
The tools check for credentials in this order:
- Orchestrate connections (
salesforce_creds) - Environment variables (
.envfile) - System environment variables
Execute SOQL queries against Salesforce.
# Example: Get all accounts with more than 100 employees
query = "SELECT Id, Name, NumberOfEmployees FROM Account WHERE NumberOfEmployees > 100"Execute SOSL searches across multiple objects.
# Example: Search for "Acme" across all searchable objects
search_term = "Acme"Create new records in Salesforce.
# Example: Create a new contact
object_type = "Contact"
record_data = '{"LastName": "Doe", "FirstName": "John", "Email": "john.doe@example.com"}'Update existing records.
# Example: Update account phone number
object_type = "Account"
record_id = "001XXXXXXXXXXXXXXX"
record_data = '{"Phone": "+1-555-123-4567"}'Delete records from Salesforce.
# Example: Delete a lead
object_type = "Lead"
record_id = "00QXXXXXXXXXXXXXXX"Retrieve specific records by ID.
# Example: Get account details
object_type = "Account"
record_id = "001XXXXXXXXXXXXXXX"Create multiple records using Bulk API.
# Example: Create multiple contacts
object_type = "Contact"
records_data = '[
{"LastName": "Smith", "Email": "smith@example.com"},
{"LastName": "Jones", "Email": "jones@example.com"}
]'Insert or update records using external IDs.
# Example: Upsert contact using custom external ID
object_type = "Contact"
external_id_field = "External_ID__c"
external_id_value = "EXT-001"
record_data = '{"LastName": "Wilson", "Email": "wilson@example.com"}'Get metadata for Salesforce objects.
# Example: Describe the Account object
object_type = "Account"List all available objects in the org.
Get current user information.
Get record counts with optional filtering.
# Example: Count accounts created today
object_type = "Account"
where_clause = "CreatedDate = TODAY"Get recently created records.
# Example: Get 10 most recent opportunities
object_type = "Opportunity"
limit = 10- "Show me all accounts with more than 100 employees"
- "Find all opportunities closing this month"
- "Get all contacts from Acme Corp"
- "Create a new contact named John Doe with email john@example.com"
- "Update account A001 with phone number 555-123-4567"
- "Delete lead L001 (with confirmation)"
- "Create 100 new contacts from this data"
- "Update all accounts in California with new tax rate"
- "Describe the Lead object and its fields"
- "Show me all custom objects in the org"
- "What are the required fields for creating an Account?"
- "How many opportunities were created today?"
- "Show me the 10 most recent cases"
- "Count all contacts by account"
The agent includes comprehensive error handling:
- Connection errors: Clear messages about authentication issues
- API errors: Detailed Salesforce API error responses
- Validation errors: Field validation and required field checks
- Permission errors: Clear messages about insufficient permissions
- Credential Management: Use environment variables or orchestrate connections
- Least Privilege: Use dedicated integration users with minimal permissions
- Audit Trail: All operations are logged in Salesforce
- Data Privacy: Agent respects field-level security and sharing rules
- Rate Limiting: Built-in respect for Salesforce API limits
Most common method for server-to-server integration.
For existing authenticated sessions.
For more secure, token-based authentication.
For orgs with IP restrictions.
- Authentication Failed: Check credentials and security token
- Insufficient Permissions: Verify user has required object permissions
- API Limits: Monitor API usage in Salesforce Setup
- Network Issues: Check firewall and proxy settings
Enable debug logging by setting environment variable:
export SF_DEBUG=trueWe welcome contributions from the community! To contribute:
- Fork this repository and create your feature branch:
git checkout -b feature/your-feature-name
- Commit your changes:
git commit -am "Add your feature or fix" - Push to your branch:
git push origin feature/your-feature-name
- Open a Pull Request on GitHub and describe your changes.
Please ensure your code is well-tested and documented. For major changes, open an issue first to discuss your proposal.
- For bugs, feature requests, or questions, please use GitHub Issues.
- For general discussion, join GitHub Discussions or contact the maintainers listed in the repository.
This project is licensed under the MIT License - see the LICENSE file for details.
- Maintainers: [Add your GitHub usernames here]
- Community: Join GitHub Discussions for Q&A and collaboration