Get Salesforce OAuth2 Authorization URL
sf_get_oauth_auth_urlGenerates the Salesforce OAuth2 authorization URL for a Connected App to obtain an authorization code, which is then exchanged for a refresh token.
Instructions
Generates the Salesforce OAuth2 authorization URL for a Connected App. Open the returned URL in a browser to approve access. After approving, Salesforce redirects to the redirect_uri with a 'code' query parameter — pass that code to sf_exchange_oauth_code to obtain your refresh token.
Set sandbox=true to use test.salesforce.com instead of login.salesforce.com.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"sf_client_id": "<sf_client_id>"
},
"name": "sf_get_oauth_auth_url"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sf_client_id | Yes | Salesforce Connected App Consumer Key (Client ID) | |
| redirect_uri | No | Redirect URI registered in your Connected App | https://login.salesforce.com/services/oauth2/success |
| sandbox | No | Use sandbox login server (test.salesforce.com) instead of login.salesforce.com |