Skip to main content
Glama
ampcome-mcps

MCP Salesforce Connector

by ampcome-mcps

run_soql_query

Execute SOQL queries to retrieve Salesforce data using the MCP Salesforce Connector.

Instructions

Executes a SOQL query against Salesforce

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesThe SOQL query to execute

Implementation Reference

  • The handler logic within handle_call_tool that executes the SOQL query using Salesforce client's query_all method and returns the results as JSON text.
    if name == "run_soql_query": query = arguments.get("query") if not query: raise ValueError("Missing 'query' argument") results = sf_client.sf.query_all(query) return [ types.TextContent( type="text", text=f"SOQL Query Results (JSON):\n{json.dumps(results, indent=2)}", ) ]
  • Tool registration in the list_tools function, defining name, description, and input schema for run_soql_query.
    name="run_soql_query", description="Executes a SOQL query against Salesforce", inputSchema={ "type": "object", "properties": { "query": { "type": "string", "description": "The SOQL query to execute", }, }, "required": ["query"], }, ),
  • JSON schema defining the input for run_soql_query tool: an object with required 'query' string property.
    inputSchema={ "type": "object", "properties": { "query": { "type": "string", "description": "The SOQL query to execute", }, }, "required": ["query"], },

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ampcome-mcps/salesforce-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server