Skip to main content
Glama

Run a SOQL query

sf_soql_query

Run a SOQL query against Salesforce REST or Tooling API, returning records with pagination details to continue fetching more results.

Instructions

Execute a SOQL query against the org (Salesforce REST /query). Returns records plus done and nextRecordsUrl for pagination. Use sf_soql_query_more to fetch the next page. Example: SELECT Id, Name FROM Account LIMIT 10

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
soqlYesThe SOQL query, e.g. "SELECT Id, Name FROM Account LIMIT 10".
toolingNoQuery the Tooling API instead of the data API (for metadata objects). Default false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the burden of behavioral disclosure. It does disclose the return fields ('records', 'done', 'nextRecordsUrl') and pagination behavior, which is useful. However, it omits any mention of side effects (or lack thereof), permission requirements, rate limits, or error behavior, leaving gaps for a tool with no annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences, each earning its place: the first states the core action, the second explains pagination and directs to the sibling, and the third gives a concrete example. The most important scoping information is front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a two-parameter tool with 100% schema coverage and no output schema, the description covers the key return shape and pagination flow, which is what an agent needs to call it and handle the response. It could additionally mention error conditions or overall result size limits, but these are secondary for a straightforward query tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% for both 'soql' and 'tooling', so the structured schema already explains the parameters. The description adds an example query but that example duplicates the one already in the schema, providing no additional parameter semantics beyond what the schema offers.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb ('Execute'), a concrete resource ('SOQL query against the org'), and even identifies the underlying REST endpoint. It clearly distinguishes itself from sf_soql_query_more by explaining that this tool returns pagination fields and that the sibling handles subsequent pages.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives an explicit alternative: 'Use sf_soql_query_more to fetch the next page.' This tells the agent exactly when not to use this tool and which sibling to call, which is the core selection guidance needed for pagination.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.