sf_run_soql

Execute a raw SOQL query against Salesforce. Use as an escape hatch when the preset tools don't cover your exact reporting shape. Supports all SOQL features including GROUP BY, aggregate functions, subqueries, and relationship traversal. Returns up to 2000 rows. See: developer.salesforce.com/docs...

Server Salesforce Marketing salesforce-marketing-mcp
Category Execute
Risk class High
Parameters 21 required

What sf_run_soql does on Salesforce Marketing

AI agents invoke sf_run_soql to trigger actions in Salesforce Marketing. What it does depends on the arguments the agent supplies, and its effects often reach beyond the immediate call — builds kicked off, notifications sent, workflows started.

ParameterTypeRequiredDescription
soql string Yes SOQL query to execute
limit integer Override LIMIT in query (appended if not present)

Parameters from the server's own tool schema.

Why sf_run_soql needs a policy

This tool allows execution of arbitrary SOQL queries with full language features (GROUP BY, subqueries, relationship traversal). Although SOQL itself cannot modify data, the tool fits the Execute category because: (1) it runs code/queries whose behavior depends on arguments, (2) the query execution can have side effects like triggering workflow rules or field audits, (3) it bypasses preset tools and acts as an…

From the tool's definition 'Execute a raw SOQL query against Salesforce' — this tool runs arbitrary queries whose effects depend on the SOQL statement provided.

Questions about sf_run_soql

What does the sf_run_soql tool do? +

Execute a raw SOQL query against Salesforce. Use as an escape hatch when the preset tools don't cover your exact reporting shape. Supports all SOQL features including GROUP BY, aggregate functions, subqueries, and relationship traversal. Returns up to 2000 rows. See: developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta. It is categorised as a Execute tool in the Salesforce Marketing MCP Server, which means it can trigger actions or run processes. Use rate limits and argument validation.

What parameters does sf_run_soql accept? +

sf_run_soql accepts 2 parameters: soql, limit. Required: soql. The full parameter table on this page comes from the server's own tool schema.

How do I enforce a policy on sf_run_soql? +

Register the Salesforce Marketing MCP server in PolicyLayer and add a rule for sf_run_soql: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Salesforce Marketing. Nothing to install.

What risk level is sf_run_soql? +

sf_run_soql is a Execute tool with high risk. Execute tools should be rate-limited and have argument validation enabled.

Can I rate-limit sf_run_soql? +

Yes. Add a rate_limit block to the sf_run_soql rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.

How do I block sf_run_soql completely? +

Set action: deny in the PolicyLayer policy for sf_run_soql. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.

What MCP server provides sf_run_soql? +

sf_run_soql is provided by the Salesforce Marketing MCP server (salesforce-marketing-mcp). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.

// LOOK UP ANOTHER SERVER

Every MCP server has a record like this.

Type a name, get the same breakdown: verified identity, auth posture, risk grade, capabilities, recommended policy.

Teams ship this data inside their own products. See what a licence covers →

// GET IN TOUCH

Have a question or want to learn more? Send us a message.

Message sent.

We'll get back to you soon.