Salesforce API wrapper that works on both Deno and Cloudflare Workers with OAuth support and MCP tool integration
The Salesforce MCP server has 21 tools with explicit schemas and descriptions visible in utils/mcp-tool-definitions.ts. Strengths: consistent verb-noun naming (sf_*), all tools have descriptions, input schemas are present with type definitions for all parameters. Critical weaknesses: (1) Descriptions are shallow and lack actionable context, most are 40-80 chars, well below the 194-char production baseline and the recommended 50-200 char LLM-optimized range. (2) Parameter descriptions are generic and lack format/constraint guidance, e.g., 'Search query string' for sf_search_leads gives no hints about what fields are searched or syntax requirements. (3) Output schemas are not documented, the code shows McpTextContent responses but does not specify what structured data (e.g., lead fields, contact details, account structure) is returned from business-logic tools like sf_create_lead or sf_search_leads. (4) No error handling guidance, tools do not describe recovery paths, retryability, or what to do on authentication failures. (5) Session/credential handling is scattered across 6 auth-related tools (sf_login, sf_get_session_info, sf_getting_started, sf_start_oauth, sf_auth_help, sf_auth_status) when 2-3 well-designed tools would suffice. (6) Tool composition issues: sf_salesforce_rest (generic REST passthrough) and sf_run_soql_query (raw SQL) bypass domain modeling, inviting LLM misuse and injection risk. These tools should be gated or avoided in production. Overall, the server is functional but not production-grade, definitions lack the depth and structure for reliable autonomous agent planning.
Get authentication instructions and URLs for setting up Salesforce credentials.
Check authentication status. If not authenticated, automatically provides OAuth login URL. Call this when user asks to login or check auth status.
Convert a Salesforce lead to an account, contact, and opportunity
Create a new account in Salesforce
Create a new contact in Salesforce
Create a new lead in Salesforce
Output schemas not documented. Business-logic tools (sf_search_leads, sf_create_lead, sf_get_lead, etc.) specify McpTextContent responses but do not describe the structured data (lead fields, account fields, contact records, etc.) returned in the response body. LLMs cannot plan downstream tool calls or extract required IDs (e.g., lead_id from create_lead) without knowing output structure.
Shallow parameter descriptions. Most parameters have trivial 1-3 word descriptions ('Search query string', 'Lead first name', 'Email address') that do not specify format, constraints, or search scope. Example: sf_search_leads has 'Search query string' with no indication of whether it searches by name, email, company, or all fields; what syntax is expected (exact match? wildcards?); or character limits.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | D | 56 | 2026-07-28+ | v2 |
| 2026-03-09 | F | 33 | 1.7.0+ | v1 |
Create a new note on a Salesforce record
Create a new opportunity in Salesforce
Create a new task in Salesforce
Delete a note from Salesforce
Retrieve details of a specific Salesforce lead by ID
Get the current MCP session ID for use in web OAuth flows. Use this ID to link web authentication with this MCP session.
Get step-by-step guidance for using Salesforce MCP tools. Call this first if you're unsure about authentication. If not authenticated, this tool will automatically start the OAuth flow.
Get the login URL for Salesforce OAuth. Returns a session_id that should be used in subsequent tool calls.
Execute a SOQL (Salesforce Object Query Language) query
Make a direct REST API call to Salesforce
Search for Salesforce leads by name, email, company, or other criteria
Directly set Salesforce credentials (accessToken and instanceUrl) for this session without OAuth
Start OAuth flow to get Salesforce credentials. IMPORTANT: Call this immediately when user asks to login. Returns a clickable URL. No parameters required - uses deployment URL from environment.
Update an existing Salesforce lead
Update an existing note in Salesforce
No error handling guidance. Tools do not document failure modes, recovery paths, or what to do on errors. Example: sf_login and OAuth tools do not explain what happens on invalid credentials, network failure, or OAuth timeout, or how the LLM should recover.
Auth tool sprawl. Six tools (sf_login, sf_get_session_info, sf_getting_started, sf_start_oauth, sf_auth_help, sf_auth_status) handle authentication when 2-3 well-designed tools would suffice. This fragments the LLM's decision logic and increases call overhead. Recommendation: consolidate into (a) sf_start_oauth (initiate login), (b) sf_check_auth (verify status), (c) sf_set_credentials (manual token entry).
Generic REST passthrough tools invite injection and misuse. sf_salesforce_rest (raw HTTP method + path + body) and sf_run_soql_query (raw SOQL) bypass domain modeling and put injection and authorization logic burden on the LLM. These should be either (a) removed entirely and replaced with domain-specific tools, or (b) heavily restricted with allow-lists for paths/queries and sandboxed execution.
Session/credential persistence scattered across parameters. Nearly every tool accepts an optional session_id parameter, but no tool documents when it is required, how it persists across calls, or what happens if omitted. LLMs cannot reliably manage session state without clear guidance.
Destructive operation (sf_delete_note) lacks confirmation pattern. The tool deletes a note permanently with no dry-run or confirmation step. An LLM mistake could destroy user data. Recommendation: add a confirm_delete=true parameter with a warning in the description, or require explicit user consent.